release #15
This file contains hidden or 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
name: release | |
on: | |
workflow_dispatch: { } | |
jobs: | |
build: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-jdk | |
- uses: ./.github/actions/setup-maven-cache | |
- name: Prepare for release | |
run: ./mvnw versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV | |
- name: Build | |
run: ./mvnw -P release --batch-mode package | |
- name: Update README.md | |
run: sed -i "s|<version>.*</version>|<version>${{ env.VERSION }}</version>|g" README.md | |
- name: Update Docs | |
run: 'sed -i "s|docs-version: .*|docs-version: ${{ env.VERSION }}|g" docs/docs/antora.yml' | |
- name: Commit release POM and Tag | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m "Release ${{ env.VERSION }}" -a | |
git tag ${{ env.VERSION }} | |
- name: Set next development version | |
run: ./mvnw versions:set -DnextSnapshot=true -DgenerateBackupPoms=false | |
- name: Commit next snapshot | |
run: | | |
git commit -m "Next development version" -a | |
- name: Push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
tags: true | |
- name: Build Changelog | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
with: | |
configuration: ".github/workflows/changelog-configuration.json" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: Release ${{ env.VERSION }} | |
draft: true | |
prerelease: false | |
body: ${{steps.build_changelog.outputs.changelog}} | |
- name: Upload all jars to Release | |
uses: AButler/upload-release-assets@v3.0 | |
with: | |
files: "target/*.jar" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-id: ${{ steps.create_release.outputs.id }} |