diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..94a36ae --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,62 @@ +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 + # Omitted due to upx: "Error: No files found." + # - 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 }} + # halp for debug err on windows with x2h.exe.exe + # - name: Halps + # run: | + # ls + - 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@v4 + with: + name: x2h-${{ matrix.os }} + path: x2h*