CI #49
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ release ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
# The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x) | |
java-version: 1.11 | |
- name: Get Snapshot Version | |
id: snapshotversion | |
run: echo ::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
- name: Get release version | |
id: version | |
uses: actions/[email protected] | |
with: | |
script: | | |
const version = "${{ steps.snapshotversion.outputs.version }}".split('-')[0] | |
core.setOutput('version', version) | |
- name: Set release version | |
run: echo $(mvn versions:set -DnewVersion=${{ steps.version.outputs.version }}) | |
- name: Commit release version | |
uses: stefanzweifel/[email protected] | |
with: | |
branch: master | |
file_pattern: pom.xml cloud/pom.xml cloud/aws/pom.xml core/pom.xml local/pom.xml local/local/pom.xml local/local-aws/pom.xml deployment/pom.xml | |
tagging_message: '${{ steps.version.outputs.version }}' | |
commit_message: release version | |
- name: Release Maven package | |
uses: samuelmeuli/action-maven-publish@v1 | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY }} | |
gpg_passphrase: ${{ secrets.GPG_PASSWORD }} | |
nexus_username: ${{ secrets.REPO_USERNAME }} | |
nexus_password: ${{ secrets.REPO_PASSWORD }} | |
- name: Rollback release | |
if: ${{ failure() }} | |
run: echo $(mvn release:rollback) | |
- name: Move to new snapshot version | |
run: echo $(mvn -B release:update-versions ) | |
- name: Commit release version | |
uses: stefanzweifel/[email protected] | |
with: | |
branch: master | |
file_pattern: pom.xml cloud/pom.xml cloud/aws/pom.xml core/pom.xml local/pom.xml local/local/pom.xml local/local-aws/pom.xml deployment/pom.xml | |
commit_message: prepare for next development cycle |