From eba08c2286c0cb23fc93cc47c07a30b09e36840f Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Tue, 7 Apr 2020 13:18:25 +0200 Subject: [PATCH] replace the maven-release-plugin workflow with plain mvn and git commands // refs #60 --- .github/workflows/release.yml | 26 +++++++++++++++++--------- README.md | 9 +++++---- pom.xml | 18 ------------------ 3 files changed, 22 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 947e753..0e8c92a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,11 +12,10 @@ on: jobs: release: - runs-on: macos-latest - + env: + MAVEN_VERSIONS_PLUGIN: org.codehaus.mojo:versions-maven-plugin:2.7 steps: - - uses: actions/checkout@v2 with: fetch-depth: '0' @@ -62,19 +61,28 @@ jobs: - name: Build the Java App and the native wrappers with Maven and codesign and notarize the Mac App run: | - mvn -B --show-version -Darguments=-Dmaven.skip.macSigning=false clean release:clean release:prepare - - - name: Push maven-release-plugin changes - # does not work on Mac: https://github.com/ad-m/github-push-action/issues/51 + mvn -B ${MAVEN_VERSIONS_PLUGIN}:set -DremoveSnapshot=true -DgenerateBackupPoms=false + export MAVEN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) + mvn -B --show-version -Dmaven.skip.macSigning=false clean package + git commit -a -m "release version ${MAVEN_PROJECT_VERSION}" + git tag v${MAVEN_PROJECT_VERSION} + + - name: Push changes at pom.xml to master + # 'github-push-action' does not work on 'macos-latest': https://github.com/ad-m/github-push-action/issues/51 #uses: ad-m/github-push-action@v0.5.0 #with: # tags: true # github_token: ${{ secrets.GITHUB_TOKEN }} run: | git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master --follow-tags --tags + + - name: Increment maven project version on development branch + run: | git fetch --prune - git checkout development - git merge master --no-ff + git checkout -f development + git merge --no-ff master + mvn -B ${MAVEN_VERSIONS_PLUGIN}:set -DnextSnapshot=true -DgenerateBackupPoms=false + git commit -a -m "prepare for next development iteration" git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:development - name: Archive Mac DiskImage distributable diff --git a/README.md b/README.md index fc3dc3d..5a74050 100644 --- a/README.md +++ b/README.md @@ -116,8 +116,9 @@ To build the JAR's, the Windows EXE and Mac App and to run the Mac App codesigni mvn -Dmaven.skip.macSigning=false clean package ``` -Or during a `mvn release:prepare` with the `maven-release-plugin`: -``` -mvn -Darguments=-Dmaven.skip.macSigning=false release:clean release:prepare -``` +### Build & release with GitHub Actions + +To build and release with GitHub Actions CI, just merge a _snapshot version_ from `development` to `master`. No need to upgrade the Maven version first or to set a git tag. Just merge to `master` and CI is doing all the hard work (as defined in `.github/workflows/release.yml`). + +The release distributables are attached to the GitHub Actions build as build artifacts and can be used for distribution on our download server. diff --git a/pom.xml b/pom.xml index 283179a..2ac6611 100644 --- a/pom.xml +++ b/pom.xml @@ -425,24 +425,6 @@ - - - org.apache.maven.plugins - maven-release-plugin - 3.0.0-M1 - - v@{project.version} - @{prefix} Release @{releaseLabel} - False - - - - org.apache.maven.scm - maven-scm-provider-gitexe - 1.11.2 - - -