Merge branch 'dev' #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Build | |
on: | |
push: | |
branches: [ main ] | |
paths: [ src/** ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event.commits[0].author.name != 'Auto Bot' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Configure git | |
run: | | |
git config user.name "Auto Bot" | |
git config user.email "<>" | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
settings-path: ${{ github.workspace }} # location for the settings.xml file | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: 'Create settings.xml' | |
uses: s4u/[email protected] | |
with: | |
githubServer: false | |
servers: '[{"id": "ossrh", "username": "Travja", "password": "${{ secrets.SONATYPE_DEPLOY_KEY }}"}, {"id": "central", "username": "Travja", "password": "${{ secrets.SONATYPE_DEPLOY_KEY }}"}]' | |
- name: Update version | |
run: python ./.github/update_version.py false true | |
- name: Publish to Maven Central | |
env: | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
mvn clean deploy -P gpg,publish -DcreateChecksum=true 2>&1 | tee log.txt | |
result_code=${PIPESTATUS[0]} | |
exit $result_code | |
- name: Update version | |
run: python ./.github/update_version.py | |
- name: Update version | |
run: python ./.github/update_version.py true | |
- name: Update README | |
run: python ./.github/update_readme.py | |
- name: Push to git | |
run: | | |
git add . | |
git reset settings.xml log.txt | |
git commit -m "Update release version" | |
git push | |
git checkout dev | |
git merge -X theirs --no-edit main | |
git push | |
- name: Notify Discord | |
run: pip install simplejson && python ./.github/notify_published.py ${{ secrets.WEBHOOK_URL }} |