-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (96 loc) · 3.12 KB
/
release_binary.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Release Binary 👘
on:
workflow_run:
workflows: ["Publish kmono 👘"]
types:
- completed
branches:
- master
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
release_exists: ${{ steps.check-release-exists.outputs.release_exists }}
release_tag: ${{ steps.release-tag.outputs.release_tag }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-latest-xlarge]
include:
- os: ubuntu-latest
binary-name: kmono-linux-amd64
- os: macos-latest
binary-name: kmono-macos-amd64
- os: macos-latest-xlarge
binary-name: kmono-macos-arm64
env:
GITHUB_USERNAME: ${{ secrets.ORG_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout git repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch Tags
run: git fetch --tags origin
- name: Set output release tag
id: release-tag
run: echo "release_tag=$(git tag -l 'com.kepler16/kmono@*' | sort -V | tail -n 1)" >> $GITHUB_OUTPUT
- name: Check gh release exists
run: |
if gh release view ${{ steps.release-tag.outputs.release_tag }} --json tagName; then
echo "release_exists=true" >> $GITHUB_OUTPUT
exit 0
else
echo "release_exists=false" >> $GITHUB_OUTPUT
fi
- uses: extractions/setup-just@v1
- uses: DeLaGuardo/[email protected]
with:
cli: latest
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: s4u/[email protected]
with:
githubServer: false
servers: |
[{"id": "github-kepler",
"username": "${{ secrets.ORG_GITHUB_ACTOR }}",
"password": "${{ secrets.ORG_GITHUB_TOKEN }}"},
{"id": "github-kepler-kmono",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"}]
- name: Build Uber for Native Image
run: just build-uber ":snapshot?" false
- name: Build Native Image
run: just build-native ":snapshot?" false
- name: Pack binary
run: |
tar -czf ${{ matrix.binary-name }}.tar.gz -C ./bin kmono
- uses: actions/upload-artifact@v3
with:
name: kmono-native-images
if-no-files-found: error
path: ${{ matrix.binary-name }}.tar.gz
release:
runs-on: ubuntu-latest
needs: build
if: needs.build.outputs.release_exists == 'false'
steps:
- uses: actions/checkout@v3
- name: Download Binary Artifacts
uses: actions/download-artifact@v2
with:
name: kmono-native-images
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: GH Release
run: gh release create ${{ needs.build.outputs.release_tag }} bin/*