Skip to content

Release

Release #30

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
persist-credentials: false
- name: Setup Java 11 and Apache Maven
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
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 "[email protected]"
- 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@v2
with:
fetch-depth: 5
persist-credentials: false
- name: Commit next development version
run: |
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 versions:set -DnewVersion=$NEW_PROJECT_VERSION-SNAPSHOT -DgenerateBackupPoms=false
echo "Update Substrate to next snapshot version"
mvn 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:[email protected]/$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@v2
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 }}