Skip to content

Commit

Permalink
replace the maven-release-plugin workflow with plain mvn and git comm…
Browse files Browse the repository at this point in the history
…ands // refs #60
  • Loading branch information
tofi86 committed Apr 7, 2020
1 parent 62a8741 commit eba08c2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 31 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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/[email protected]
#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
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
18 changes: 0 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -425,24 +425,6 @@
</executions>
</plugin>

<!-- maven-release-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<scmReleaseCommitComment>@{prefix} Release @{releaseLabel}</scmReleaseCommitComment>
<pushChanges>False</pushChanges>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.11.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

0 comments on commit eba08c2

Please sign in to comment.