fix: native build #17
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: build-release-on-main-push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-release-on-main-push: | |
if: ${{ !contains(github.event.head_commit.message, '[release]') }} # prevent recursive releases | |
permissions: | |
contents: write | |
packages: write | |
strategy: | |
max-parallel: 1 # otherwise the release upload will fail | |
matrix: | |
os: [ macos-14 ] # ubuntu-latest, windows-latest, macos-13, | |
runs-on: ${{ matrix.os }} | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- id: setup-graalvm | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
distribution: 'liberica' | |
java-version: '21' | |
java-package: 'jdk+fx' | |
cache: 'maven' | |
- id: show-paths | |
run: | | |
echo "GRAALVM_HOME: $GRAALVM_HOME" | |
echo "JAVA_HOME: $JAVA_HOME" | |
java --version | |
native-image --version | |
- id: maven-build-verify | |
run: mvn --batch-mode -Pnative-graalvm-default clean package | |
- id: configure-git-user | |
uses: qoomon/actions--setup-git@v1 | |
with: | |
user: bot | |
- id: get-version-from-pom | |
uses: dostonhamrakulov/[email protected] | |
with: | |
file_path: ${{ github.workspace }}/pom.xml | |
- id: get-latest-tag | |
uses: WyriHaximus/github-action-get-previous-tag@v1 | |
- name: tag-version | |
if: ${{ steps.get-version-from-pom.outputs.version != steps.get-latest-tag.outputs.tag}} | |
uses: tvdias/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.get-version-from-pom.outputs.version }} | |
- id: create-release-notes | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
tag_name: ${{ steps.get-version-from-pom.outputs.version }} | |
files: | | |
target/log-gazer*.tar.gz | |
target/log-gazer*.zip | |
- id: merge-main-to-dev | |
run: | | |
git checkout dev | |
git pull | |
git merge --no-ff main -m "[release] auto-merge released main back to dev" | |
git push |