[maven-release-plugin] prepare release 4.2.0 #60
Workflow file for this run
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 workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
name: Maven Package | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: version | |
id: version | |
run: echo "{version}=$(git describe --tags --abbrev=1)" >> $GITHUB_OUTPUT | |
- name: changelog | |
id: changelog | |
run: echo "{changelog}=$(git log --oneline)' ${{ github.event.before }}..HEAD)" >> $GITHUB_OUTPUT | |
# - name: 1. Import GPG key | |
# id: import_gpg | |
# uses: crazy-max/ghaction-import-gpg@v4 | |
# with: | |
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
# passphrase: ${{ secrets.GPG_PASS_PHRASE }} | |
# git-user-signingkey: true | |
# git-commit-gpgsign: true | |
- name: 2. Set up Maven | |
uses: stCarolas/setup-maven@v5 | |
with: | |
maven-version: 3.8.8 | |
- name: 4. Set up JDK | |
uses: actions/setup-java@v4.4.0 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
settings-path: ${{ github.workspace }} # location for the settings.xml file | |
- name: 5. Build and packaging | |
run: | | |
mvn -B -V -T 1 -DskipTests clean package | |
mvn package assembly:single | |
bash shrink_package.sh y | |
- name: 6. Calculate SHA256SUM | |
run: | | |
cd target/addax | |
sha256sum addax-${{ steps.version.outputs.version }}.tar.gz > addax-${{ steps.version.outputs.version }}.tar.gz.sha256sum.asc | |
- name: 7. Create release page | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: ${{ steps.version.outputs.version }} | |
tag_name: ${{ github.ref }} | |
body: | | |
# Addax ${{ steps.version.outputs.version }} has released! 🎉 | |
## Changes | |
${{ steps.changelog.outputs.body }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
- name: 8. Upload to GitHub | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
target/addax/addax-${{ steps.version.outputs.version }}.tar.gz | |
target/addax/addax-${{ steps.version.outputs.version }}.tar.gz.sha256sum.asc | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} |