Release #34
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 5 | |
| persist-credentials: false | |
| - name: Setup Java 11 and Apache Maven | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 11 | |
| server-id: central | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Configure GIT | |
| run: | | |
| git config --global user.name "Gluon Bot" | |
| git config --global user.email "githubbot@gluonhq.com" | |
| - name: Publish to Maven Central | |
| id: deploy | |
| run: | | |
| mvn deploy -DskipTests=true -B -U -Prelease | |
| echo ::set-output name=exit_code::$? | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| commit-development-version: | |
| runs-on: ubuntu-latest | |
| needs: [ release ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 5 | |
| persist-credentials: false | |
| - name: Commit next development version | |
| run: | | |
| git config user.email "githubbot@gluonhq.com" | |
| git config user.name "Gluon Bot" | |
| TAG=${GITHUB_REF/refs\/tags\//} | |
| SUBSTRATE_VERSION=$(mvn help:evaluate -Dexpression=substrate.version -q -DforceStdout) | |
| NEW_SUBSTRATE_VERSION=${SUBSTRATE_VERSION%.*}.$((${SUBSTRATE_VERSION##*.} + 1)) | |
| NEW_PROJECT_VERSION=${TAG%.*}.$((${TAG##*.} + 1)) | |
| echo "Update project version to next snapshot version" | |
| mvn -ntp versions:set -DnewVersion=$NEW_PROJECT_VERSION-SNAPSHOT -DgenerateBackupPoms=false | |
| echo "Update Substrate to next snapshot version" | |
| mvn -ntp versions:set-property -Dproperty=substrate.version -DnewVersion=$NEW_SUBSTRATE_VERSION-SNAPSHOT -DgenerateBackupPoms=false | |
| git commit pom.xml -m "Prepare development of $NEW_PROJECT_VERSION" | |
| git push https://gluon-bot:$PAT@github.com/$GITHUB_REPOSITORY HEAD:master | |
| shell: bash | |
| env: | |
| PAT: ${{ secrets.PAT }} | |
| release-notes: | |
| runs-on: ubuntu-latest | |
| needs: [ release ] | |
| steps: | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| update-repositories: | |
| runs-on: ubuntu-latest | |
| needs: [ release ] | |
| steps: | |
| - name: Install packages | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install xmlstarlet | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 5 | |
| persist-credentials: false | |
| - name: Update projects | |
| if: steps.deploy.outputs.exit_code == 0 | |
| run: | | |
| export TAG=${GITHUB_REF/refs\/tags\//} | |
| bash $GITHUB_WORKSPACE/.github/scripts/release.sh | |
| shell: bash | |
| env: | |
| GITHUB_PASSWORD: ${{ secrets.PAT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |