Release #9
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: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: 'Version to release. Ex. 1.0.1' | |
required: true | |
type: string | |
developmentVersion: | |
description: 'Next SNAPSHOT Version. Ex. 1.0.2-SNAPSHOT' | |
required: true | |
type: string | |
jobs: | |
build: | |
name: Release | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# We need a personal access token to be able to push to a protected branch | |
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
- name: Setup JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 11 | |
java-package: jdk | |
distribution: adopt | |
architecture: x64 | |
# this also creates settings.xml with the following server | |
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: SONATYPE_USERNAME # env variable for username in deploy | |
server-password: SONATYPE_PASSWORD # env variable for token in deploy | |
# only signed artifacts will be released to maven central. this sets up things for the maven-gpg-plugin | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase | |
settings-path: ${{ github.workspace }} | |
- name: Configure Git User | |
run: | | |
git config user.email "oss@expediagroup.com" | |
git config user.name "eg-oss-ci" | |
- name: Release artifacts | |
run: | | |
mvn -e -DdevelopmentVersion=${{ inputs.developmentVersion }} -DreleaseVersion=${{ inputs.releaseVersion }} \ | |
-Dresume=false release:prepare release:perform --settings $GITHUB_WORKSPACE/settings.xml \ | |
-Djib.skip -DskipTests -Darguments="-e -DskipTests -Djib.skip" --activate-profiles sonatype-oss-release-github-actions \ | |
--batch-mode --show-version --no-transfer-progress | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} |