Skip to content

release

release #29

Workflow file for this run

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
jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: 19
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- 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: |
mvn -V --no-transfer-progress --batch-mode --settings .settings.xml clean \
-DreleaseVersion='${{ github.event.inputs.release_ver }}' \
-DdevelopmentVersion='${{ github.event.inputs.snapshot_ver }}' \
release:prepare
# re:gpg signing see: https://gist.github.com/sualeh/ae78dc16123899d7942bc38baba5203c
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: mvn release:perform
env:
SONATYPE_USER: ${{ secrets.OSSRH_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_EXECUTABLE: gpg
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
run: |
mvn -V --no-transfer-progress --batch-mode --settings .settings.xml \
-Darguments='--settings .settings.xml -Dlicense.skip=true -DskipTests -Dmaven.install.skip=true -P release' \
release:perform