Update version #7
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 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.ACTIONS_PAT }} | |
- name: Configure git | |
run: | | |
git config user.name "Auto Bot" | |
git config user.email "<>" | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
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 README | |
run: python ./.github/update_readme.py | |
- name: Tag release version | |
run: | | |
git add . | |
git commit -m "[ci skip] Update release version" | |
version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout) | |
git tag -a $version -m "Release $version" | |
git push | |
git push --tags | |
git fetch --unshallow --all | |
git checkout dev | |
git merge -X theirs --no-edit main | |
- name: Update version | |
run: python ./.github/update_version.py | |
- name: Update version | |
run: python ./.github/update_version.py true | |
- name: Push to git | |
run: | | |
git add . | |
git commit -m "[ci skip] Update version for development" | |
git push | |
- name: Notify Discord | |
run: pip install simplejson && python ./.github/notify_published.py ${{ secrets.WEBHOOK_URL }} |