-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (120 loc) · 3.99 KB
/
release.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build and upload release
on:
push:
tags:
- '**'
jobs:
release-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install SDL2
run: sudo apt install -y libsdl2-dev
- name: Build kalast
run: cargo build -r && strip target/release/kalast
- name: Build examples
run: cargo build -r --example viewer-picker && strip target/release/examples/viewer-picker
- name: Make bundle
run: |
mkdir -p bin/ubuntu
cp -r examples bin/ubuntu
cp target/release/kalast bin/ubuntu
cp target/release/examples/viewer-picker bin/ubuntu/examples/viewer-picker
cd bin/ubuntu
cp -r examples/thermal/cfg .
tar cvzf kalast-${{ github.ref_name }}-ubuntu.tar.gz *
mv kalast-${{ github.ref_name }}-ubuntu.tar.gz ..
- name: Release
uses: softprops/action-gh-release@v1
with:
files: bin/kalast-${{ github.ref_name }}-ubuntu.tar.gz
prerelease: true
release-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install SDL2
run: brew install SDL2
- name: Build kalast
run: cargo build -r && strip target/release/kalast
- name: Build examples
run: cargo build -r --example viewer-picker && strip target/release/examples/viewer-picker
- name: Make bundle
run: |
mkdir -p bin/macos
cp -r examples bin/macos
cp target/release/kalast bin/macos
cp target/release/examples/viewer-picker bin/macos/examples/viewer-picker
cd bin/macos
cp -r examples/thermal/cfg .
tar cvzf kalast-${{ github.ref_name }}-macos.tar.gz *
mv kalast-${{ github.ref_name }}-macos.tar.gz ..
- name: Release
uses: softprops/action-gh-release@v1
with:
files: bin/kalast-${{ github.ref_name }}-macos.tar.gz
prerelease: true
release-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Use SDL2 from repo/include/win
run: |
cp include/win/SDL2.dll .
cp include/win/SDL2.lib .
- name: Build kalast
run: cargo build -r
- name: Build examples
run: cargo build -r --example viewer-picker
- name: Make bundle
run: |
mkdir -p bin/win
cp -r examples bin/win
cp target/release/kalast.exe bin/win
cp target/release/examples/viewer-picker.exe bin/win/examples/viewer-picker
mv SDL2.dll bin/win
mv SDL2.lib bin/win
cp include/kalast.ico bin/win
cp include/preferences.yaml bin/win
cp README.md bin/win
cd bin/win
cp -r examples/thermal/cfg .
Compress-Archive * kalast-${{ github.ref_name }}-win.zip
mv kalast-${{ github.ref_name }}-win.zip ..
- name: Compile installer with Inno
run: cd bin && iscc ./installer.iss
- name: Release
uses: softprops/action-gh-release@v1
with:
files: bin/setup-kalast-${{ github.ref_name }}.exe
prerelease: true