Release #59
Workflow file for this run
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 | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 5 | |
persist-credentials: false | |
- name: Setup Java 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Import GPG keys | |
run: | | |
gpg --import --batch <(echo "$GPG_PRIVATE_KEY") &> /dev/null | |
# Gradle doesn't support GPG 2.1 and later: https://github.com/gradle/gradle/issues/888 | |
gpg --export-secret-keys --pinentry-mode loopback --passphrase="$GPG_PASSPHRASE" > ~/.gnupg/secring.gpg | |
rm -rf /tmp/secret | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Deploy to Sonatype Nexus | |
id: deploy | |
run: | | |
./gradlew publish closeAndReleaseRepository --info -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEYNAME -Psigning.password=$GPG_PASSPHRASE -Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg | |
echo ::set-output name=exit_code::$? | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} | |
- name: Release Client plugins | |
if: steps.deploy.outputs.exit_code == 0 | |
run: | | |
TAG=${GITHUB_REF/refs\/tags\//} | |
bash $GITHUB_WORKSPACE/.github/scripts/release-plugins.sh $TAG $PAT | |
env: | |
PAT: ${{ secrets.PAT }} | |
- name: Commit next development version | |
if: steps.deploy.outputs.exit_code == 0 | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Gluon Bot" | |
TAG=${GITHUB_REF/refs\/tags\//} | |
newVersion=${TAG%.*}.$((${TAG##*.} + 1)) # Update version by 1 | |
sed -i -z "0,/version = $TAG/s//version = $newVersion-SNAPSHOT/" gradle.properties | |
git commit gradle.properties -m "Prepare development of $newVersion" | |
git push https://gluon-bot:[email protected]/$GITHUB_REPOSITORY HEAD:master | |
env: | |
PAT: ${{ secrets.PAT }} |