Skip to content

Release 2.0.2

Release 2.0.2 #14

Workflow file for this run

name: master release
on:
pull_request:
branches:
- master
types: [closed]
jobs:
build-release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
persist-credentials: false
- name: JDK 8 Set
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Maven Cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Maven Get Version
run: echo MVN_CURRENT_VERSION=$(mvn -B -f /home/runner/work/spark-temporalquery/spark-temporalquery/pom.xml -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec) >> $GITHUB_ENV
- name: Set Release Version
run: echo MVN_RELEASE_VERSION=${MVN_CURRENT_VERSION/-SNAPSHOT/} >> $GITHUB_ENV
#- name: Printenv
# run: |
# printenv
- name: Maven Set Release Version
run: sed -i "/${MVN_CURRENT_VERSION}/{s//${MVN_RELEASE_VERSION}/;:p;n;bp}" pom.xml
- name: Maven deploy to sonatype for Scala 2.11
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_USERNAME }}
nexus_password: ${{ secrets.SONATYPE_PASSWORD }}
maven_profiles: scala-2.11,release-sonatype
maven_args: -B -f pom.xml
- name: Maven deploy to sonatype for Scala 2.12
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_USERNAME }}
nexus_password: ${{ secrets.SONATYPE_PASSWORD }}
maven_profiles: scala-2.12,release-sonatype
maven_args: -B -f pom.xml
- name: Git Commit and Tag Release
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || git commit -m "Release version ${MVN_RELEASE_VERSION}" # only if there is something to commit
git tag -f ${MVN_RELEASE_VERSION} -m "Release ${MVN_RELEASE_VERSION}"
- name: Git Pull Master
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git pull
- name: Git Push Master
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# DEVELOP BRANCH
- name: Develop Git Checkout
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
persist-credentials: false
- name: Git Merge to develop
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git branch
git fetch --all
git branch
git checkout develop
git merge origin/master
git diff-index --quiet HEAD || git commit -m "Release version ${MVN_RELEASE_VERSION}" # only if there is something to committ
- name: Develop Git Push Release
uses: ad-m/github-push-action@master
with:
branch: develop
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Develop Get Next Version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ env.MVN_RELEASE_VERSION }}
version-fragment: bug
- name: Develop Set Next Snapshot version
run: sed -i "/${MVN_RELEASE_VERSION}/{s//${{ steps.bump_version.outputs.next-version }}-SNAPSHOT/;:p;n;bp}" pom.xml
- name: Develop Git Commit Snapshot
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Increment to next SNAPSHOT release" -a
- name: Develop Git Push Snapshot
uses: ad-m/github-push-action@master
with:
branch: develop
github_token: ${{ secrets.GITHUB_TOKEN }}