-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (76 loc) · 2.01 KB
/
release-cli.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Release CLI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-cli:
strategy:
matrix:
include:
- arch: linux-amd64
runs-on: ubuntu-latest
- arch: linux-arm64
runs-on: arm-c8
- arch: macos-amd64
runs-on: macos-latest
- arch: macos-arm64
runs-on: macos-latest-xlarge
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout git repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch Tags
run: git fetch --tags origin
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: 'maven'
cache-dependency-path: '**/deps.edn'
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: extractions/setup-just@v2
- uses: DeLaGuardo/[email protected]
with:
cli: latest
- name: Build
run: |
just build-native-cli
- name: Pack binary
run: |
tar -czf kmono-${{ matrix.arch }}.tar.gz -C ./target/bin kmono
- uses: actions/upload-artifact@v3
with:
name: binaries
if-no-files-found: error
path: kmono-${{ matrix.arch }}.tar.gz
release-cli:
runs-on: ubuntu-latest
needs: [build-cli]
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
steps:
- uses: actions/checkout@v4
- name: Download Binary Artifacts
uses: actions/download-artifact@v3
with:
name: binaries
path: bin
- name: Calculate checksums
run: |
for file in bin/*; do
shasum -a 256 "$file" >> checksums.txt
done
mv checksums.txt bin/checksums.txt
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/*