release #48
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: | |
workflow_dispatch: | |
inputs: | |
release_ver: | |
description: 'Version to use when releasing' | |
required: false | |
snapshot_ver: | |
description: 'Version to use for next development iteration' | |
required: false | |
gpg_secret: | |
description: 'Name of the `secret` to use as the GPG key to sign the release' | |
required: true | |
gpg_passphrase: | |
description: 'GPG passphrase to unlock the GPG secret' | |
required: true | |
sonatype_user: | |
description: 'Sonatype OSSRH username' | |
required: true | |
sonatype_password: | |
description: 'Sonatype OSSRH password' | |
required: true | |
jobs: | |
release: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: setup git | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
- name: mvn clean release:prepare | |
run: "./mvnw -V --no-transfer-progress --batch-mode --settings .settings.xml clean \ | |
-DreleaseVersion='${{ github.event.inputs.release_ver }}' \ | |
-DdevelopmentVersion='${{ github.event.inputs.snapshot_ver }}' \ | |
release:prepare" | |
- id: install-secret-key | |
name: Install gpg secret key | |
run: | | |
cat <(echo -e "${{ secrets[github.event.inputs.gpg_secret] }}") | gpg --batch --import | |
gpg --list-secret-keys --keyid-format LONG | |
- name: mvn release:perform | |
env: | |
SONATYPE_USER: ${{ github.event.inputs.sonatype_user }} | |
SONATYPE_PASSWORD: ${{ github.event.inputs.sonatype_password }} | |
GPG_EXECUTABLE: gpg | |
GPG_PASSPHRASE: ${{ github.event.inputs.gpg_passphrase }} | |
run: "./mvnw -V --no-transfer-progress --batch-mode --settings .settings.xml \ | |
-Darguments='--settings .settings.xml -Dlicense.skip=true -DskipTests -Dmaven.install.skip=true ' \ | |
release:perform -Prelease" |