-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.37 KB
/
release-binaries.yml
File metadata and controls
56 lines (46 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build release binaries
on:
release:
types: [published]
jobs:
build:
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
distribution: graalvm
java-version: '25'
components: native-image
cache: maven
- name: Build JAR
run: mvn clean package
- name: Build native image
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
native-image.cmd -jar target/gkit-*.jar -o gkit
else
native-image -jar target/gkit-*.jar -o gkit
fi
shell: bash
- name: Create archive
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
ARCH=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
if [[ "$OS" == "windows" ]]; then FILE=gkit.exe; else FILE=gkit; fi
ARCHIVE_NAME="gkit-${OS}-${ARCH}.tar.gz"
tar -czf "$ARCHIVE_NAME" "$FILE"
shell: bash
- name: Upload release asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
files: |
gkit-*.tar.gz