Generate changelog and plugin archive for new release #1
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
name: Generate changelog and plugin archive for new release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
suffix: Linux-x86_64.tar.xz | |
gu-tool: gu | |
- os: macos-latest | |
suffix: Darwin-x86_64.tar.xz | |
gu-tool: gu | |
- os: windows-latest | |
suffix: Windows-x86_64.zip | |
gu-tool: gu.cmd | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Graalvm | |
# 4.0 | |
uses: DeLaGuardo/setup-graalvm@a766aa7b5fcc0a801fa3d4fd521ca299c03c9c00 | |
with: | |
graalvm: '21.0.0.2' | |
java: java11 | |
- name: Install native-image | |
run: | | |
${{ matrix.gu-tool }} install native-image | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Get the version | |
id: get_version | |
# v2 | |
uses: battila7/get-version-action@d97fbc34ceb64d1f5d95f4dfd6dce33521ccccf5 | |
- name: Set up Visual C Build Tools Workload for Visual Studio 2017 Build Tools | |
run: | | |
choco install visualstudio2017-workload-vctools | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Set env variables and run the Maven build | |
shell: cmd | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" | |
call mvn -B verify -Pnative -f java | |
7z a java/alizer-cli/target/alizer-cli-${{ steps.get_version.outputs.version }}-${{ matrix.suffix }} java/alizer-cli/target/alizer-cli-${{ steps.get_version.outputs.version }}-runner.exe | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Build with Maven | |
run: | | |
mvn -B verify -Pnative -f java | |
tar cfJ java/alizer-cli/target/alizer-cli-${{ steps.get_version.outputs.version }}-${{ matrix.suffix }} java/alizer-cli/target/alizer-cli-${{ steps.get_version.outputs.version }}-runner | |
if: ${{ matrix.os != 'windows-latest' }} | |
- name: Simple conventional changelog | |
# 0.0.11 | |
uses: lstocchi/simple-conventional-changelog@13071c09073f5deddf03d44d9af6a8b0f81ef227 | |
id: changelog | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
current-tag: ${{ steps.get_version.outputs.version }} | |
types-mapping: 'feat:Features,fix:Bug Fixes,docs:Documentation,refactor:Refactoring,build:Builds,chore:Other' | |
- run: | | |
echo '${{ steps.changelog.outputs.changelog }}' | |
- name: Create or update Release | |
id: create_release | |
# v1 | |
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
allowUpdates: true | |
artifact: java/alizer-cli/target/alizer-cli-${{ steps.get_version.outputs.version }}-${{ matrix.suffix }} | |
artifactContentType: application/zip | |
body: ${{ steps.changelog.outputs.changelog }} | |
name: ${{ steps.get_version.outputs.version }} | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
replacesArtifacts: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |