-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (87 loc) · 2.98 KB
/
publish.yaml
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
name: Publish
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: mkdir bin
- name: Get Version
id: vars
run: echo "version=$(echo $GITHUB_REF_NAME | sed 's/^v//')" >> $GITHUB_OUTPUT
- name: Write Version file
run: |
touch VERSION
echo ${{steps.vars.outputs.version}} > VERSION
- name: Compile for Linux arm64
run: |
deno compile \
--target=aarch64-unknown-linux-gnu \
--output=bin/staticalize-linux-arm64 \
--include=VERSION \
--allow-read --allow-write --allow-net main.ts
- name: Compile for macOS arm64
run: |
deno compile \
--target=aarch64-apple-darwin \
--output=bin/staticalize-macos-arm64 \
--include=VERSION \
--allow-read --allow-write --allow-net main.ts
- name: Compile for Linux x64
run: |
deno compile \
--target=x86_64-unknown-linux-gnu \
--output=bin/staticalize-linux \
--include=VERSION \
--allow-read --allow-write --allow-net main.ts
- name: Compile for Windows x64
run: |
deno compile \
--target=x86_64-pc-windows-msvc \
--output=bin/staticalize-windows \
--include=VERSION \
--allow-read --allow-write --allow-net main.ts
- name: Compile for macOS x64
run: |
deno compile \
--target=x86_64-apple-darwin \
--output=bin/staticalize-macos \
--include=VERSION \
--allow-read --allow-write --allow-net main.ts
- name: Compress binaries
run: |
cd bin
zip staticalize-windows.zip staticalize-windows.exe
tar -czf staticalize-macos.tar.gz staticalize-macos
tar -czf staticalize-macos-arm64.tar.gz staticalize-macos-arm64
tar -czf staticalize-linux.tar.gz staticalize-linux
tar -czf staticalize-linux-arm64.tar.gz staticalize-linux-arm64
rm staticalize-windows.exe \
staticalize-macos \
staticalize-macos-arm64 \
staticalize-linux \
staticalize-linux-arm64
- name: Configure git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Commit and push binaries
run: |
git add bin/
git commit -m "Add compiled binaries for ${{ github.ref_name }}"
git push origin HEAD:${{ github.ref_name }} --force
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.JACK_GITHUB_TOKEN }}
make_latest: true
files: bin/*