Skip to content

Add github action

Add github action #5

Workflow file for this run

name: Create Release and Publish
on:
push:
tags:
- 'v*'
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Release
uses: softprops/action-gh-release@v1
releases-matrix:
name: Release Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
file: x2h
args: --best --lzma
strip: true
- os: windows-latest
file: x2h.exe
args: -9
strip: false
- os: macos-latest
file: x2h
args: --best
strip: true
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Build
run: |
gradle build
native-image --no-fallback -jar build/libs/x2h.jar ${{ matrix.file }}
- name: Compress binaries
uses: svenstaro/upx-action@v2
with:
file: ${{ matrix.file }}
args: ${{ matrix.args }}
strip: ${{ matrix.strip }}
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: x2h-${{ matrix.os }}
path: x2h*