Skip to content

release

release #42

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
perform_version:
description: 'tag to (re-)perform (in case of release:perform failure)'
required: false
default: ''
env:
MAVEN_FLAGS: "-B --no-transfer-progress"
MAVEN_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3"
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
if: github.event.inputs.perform_version == ''
uses: actions/checkout@v2
- name: Checkout full repository
if: github.event.inputs.perform_version != ''
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Set Java to version 8
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 8
- name: Setup git user
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Pierre-Alexandre Meyer"
git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "[email protected]:"
- name: Configure Java
uses: actions/setup-java@v1
with:
java-version: 8
server-id: sonatype-nexus-staging
server-username: OSSRH_USER
server-password: OSSRH_PASS
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Release artifacts
if: github.event.inputs.perform_version == ''
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mvn ${MAVEN_FLAGS} release:clean release:prepare release:perform
- name: Perform release
if: github.event.inputs.perform_version != ''
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
echo "scm.url=scm\:git\:[email protected]\:${GITHUB_REPOSITORY}.git" > release.properties
echo "scm.tag=${{ github.event.inputs.perform_version }}" >> release.properties
mvn ${MAVEN_FLAGS} release:perform