-
Notifications
You must be signed in to change notification settings - Fork 2
208 lines (180 loc) · 7.2 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
release:
name: Release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
target:
- name: x86_64-unknown-linux-gnu
file_name : "linux-x86_64"
os: ubuntu-22.04
# - name: aarch64-unknown-linux-gnu
# file_name : "linux-aarch64"
# os: ubuntu-22.04
# - name: i686-pc-windows-msvc
# file_name : "windows-x86"
# os: windows-latest
- name: x86_64-pc-windows-msvc
file_name : "windows-x86_64"
os: windows-latest
- name: aarch64-pc-windows-msvc
file_name: "windows-aarch64"
os: windows-latest
- name: x86_64-apple-darwin
file_name : "macos-x86_64"
os: macos-latest
- name: aarch64-apple-darwin
file_name : "macos-aarch64"
os: macos-latest
runs-on: ${{ matrix.target.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.name }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm' # Set this to npm, yarn or pnpm.
- run: pnpm install
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.name }}
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y libudev-dev libusb-1.0-0-dev libssl-dev pkg-config
sudo apt install libhidapi-dev -y
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --target ${{ matrix.target.name }}
- name: Windows package # 将编译好的二进制文件打包,如果是Windows就打包exe文件,其它系统打包AirISP*文件
if: runner.os == 'Windows'
run : |
mkdir -p ${{ github.workspace }}/release
cd src-tauri/target/${{ matrix.target.name }}/release
mkdir ${{ github.workspace }}/release/AirISP-next/
cp AirISP-next.exe ${{ github.workspace }}/release/AirISP-next/
cd ${{ github.workspace }}/release
7z a -tzip ${{ github.workspace }}/AirISP-${{ github.ref_name }}-${{ matrix.target.file_name }}.zip AirISP-next
- name: Linux rename
if: runner.os == 'Linux'
run : |
cd src-tauri/target/${{ matrix.target.name }}/release
mv air-isp-next AirISP-next
- name: Package
if: runner.os != 'Windows'
run : |
mkdir -p ${{ github.workspace }}/release
cd src-tauri/target/${{ matrix.target.name }}/release
chmod +x AirISP-next
mkdir ${{ github.workspace }}/release/AirISP-next/
cp AirISP-next ${{ github.workspace }}/release/AirISP-next/
cd ${{ github.workspace }}/release
tar zcvf ${{ github.workspace }}/AirISP-${{ github.ref_name }}-${{ matrix.target.file_name }}.tar.gz AirISP-next
- name: Create Windows release
if: runner.os == 'Windows'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ github.workspace }}/AirISP-${{ github.ref_name }}-${{ matrix.target.file_name }}.zip, src-tauri/target/${{ matrix.target.name }}/release/bundle/nsis/*.exe"
- name: Create release
if: runner.os != 'Windows'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ github.workspace }}/AirISP-${{ github.ref_name }}-${{ matrix.target.file_name }}.tar.gz, src-tauri/target/${{ matrix.target.name }}/release/bundle/*"
release-linux-aarch64:
name: release-linux-aarch64
permissions:
contents: write
strategy:
fail-fast: false
matrix:
target:
- name: aarch64-unknown-linux-gnu
file_name : "linux-aarch64"
os: ubuntu-22.04
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.name }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm' # Set this to npm, yarn or pnpm.
- run: pnpm install
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.name }}
- name: Build
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu -y
sudo dpkg --add-architecture arm64
sudo rm -rf /etc/apt/sources.list
sudo cp ./.ubuntu-22.04.source /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y libudev-dev libusb-1.0-0-dev libssl-dev pkg-config
sudo apt install libhidapi-dev -y
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
sudo apt-get install -y libudev-dev:arm64 libusb-1.0-0-dev:arm64 libssl-dev:arm64
sudo apt-get install -y libgtk-3-dev:arm64 libwebkit2gtk-4.0-dev:arm64 libayatana-appindicator3-dev:arm64 librsvg2-dev:arm64
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
pnpm install
pnpm tauri build --target aarch64-unknown-linux-gnu
- name: Linux rename
if: runner.os == 'Linux'
run : |
cd src-tauri/target/${{ matrix.target.name }}/release
mv air-isp-next AirISP-next
- name: Package
run : |
mkdir -p ${{ github.workspace }}/release
cd src-tauri/target/${{ matrix.target.name }}/release
chmod +x AirISP-next
mkdir ${{ github.workspace }}/release/AirISP-next/
cp AirISP-next ${{ github.workspace }}/release/AirISP-next/
cd ${{ github.workspace }}/release
tar zcvf ${{ github.workspace }}/AirISP-${{ github.ref_name }}-${{ matrix.target.file_name }}.tar.gz AirISP-next
- name: "release"
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ github.workspace }}/AirISP-${{ github.ref_name }}-${{ matrix.target.file_name }}.tar.gz, src-tauri/target/${{ matrix.target.name }}/release/bundle/*"