Skip to content

Add github action

Add github action #24

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
id: create_release
uses: softprops/action-gh-release@v1
releases-matrix:
needs: [create_release]
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
args: -9
strip: false
# - os: macos-latest
# file: x2h-mac
# 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 }}
ls
- name: Compress binary
uses: svenstaro/upx-action@v2
with:
files: |
x2h*
args: ${{ matrix.args }}
strip: ${{ matrix.strip }}
- name: Upload binary
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
files: x2h*