-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (180 loc) · 6.92 KB
/
release.yml
File metadata and controls
216 lines (180 loc) · 6.92 KB
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
209
210
211
212
213
214
215
216
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-windows:
runs-on: windows-latest
outputs:
version: ${{ steps.version.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- name: Read version
id: version
shell: pwsh
run: |
$v = (Select-String -Path "matchy/Cargo.toml" -Pattern '^version\s*=\s*"([^"]+)"' | Select-Object -First 1).Matches.Groups[1].Value
echo "VERSION=$v" >> $env:GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Remove local-only cargo config
shell: pwsh
run: Remove-Item -Path matchy/.cargo/config.toml -Force -ErrorAction SilentlyContinue
- name: Install frontend dependencies
working-directory: matchy/crates/matchy-app/frontend
run: npm ci
- name: Build Tauri app
shell: pwsh
working-directory: matchy/crates/matchy-app
run: |
if ("${{ github.ref_name }}" -match "-beta|-rc|-alpha") {
.\frontend\node_modules\.bin\tauri.cmd build --bundles nsis
} else {
.\frontend\node_modules\.bin\tauri.cmd build
}
- name: Build CLI
working-directory: matchy
run: cargo build --release -p matchy-cli
- name: Create portable zip
shell: pwsh
run: |
$Version = "${{ steps.version.outputs.VERSION }}"
New-Item -ItemType Directory -Force -Path dist | Out-Null
Compress-Archive -Path "matchy/target/release/matchy-app.exe" `
-DestinationPath "dist/MatchY-${Version}-x64-windows-portable.zip" -Force
- name: Upload NSIS installer
uses: actions/upload-artifact@v4
with:
name: windows-nsis
path: matchy/target/release/bundle/nsis/*.exe
- name: Upload MSI
if: ${{ !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc') && !contains(github.ref_name, '-alpha') }}
uses: actions/upload-artifact@v4
with:
name: windows-msi
path: matchy/target/release/bundle/msi/*.msi
- name: Upload portable zip
uses: actions/upload-artifact@v4
with:
name: windows-portable
path: dist/*.zip
- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: windows-cli
path: matchy/target/release/matchy.exe
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
musl-tools
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- name: Install frontend dependencies
working-directory: matchy/crates/matchy-app/frontend
run: npm ci
- name: Build Tauri app (AppImage)
working-directory: matchy/crates/matchy-app
run: ./frontend/node_modules/.bin/tauri build --bundles appimage
- name: Build CLI (static musl)
working-directory: matchy
run: cargo build --release -p matchy-cli --target x86_64-unknown-linux-musl
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: linux-appimage
path: matchy/target/release/bundle/appimage/*.AppImage
- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: linux-cli
path: matchy/target/x86_64-unknown-linux-musl/release/matchy
build-macos-arm:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install frontend dependencies
working-directory: matchy/crates/matchy-app/frontend
run: npm ci
- name: Build Tauri app (DMG, unsigned)
working-directory: matchy/crates/matchy-app
run: ./frontend/node_modules/.bin/tauri build --bundles dmg
env:
APPLE_SIGNING_IDENTITY: '-'
- name: Build CLI
working-directory: matchy
run: cargo build --release -p matchy-cli
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: macos-arm-dmg
path: matchy/target/release/bundle/dmg/*.dmg
- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: macos-arm-cli
path: matchy/target/release/matchy
release:
needs: [build-windows, build-linux, build-macos-arm]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Read version
id: version
run: |
VERSION=$(grep '^version\s*=' matchy/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: '*'
merge-multiple: false
- name: Rename and stage release assets
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
mkdir -p release-assets
find artifacts/windows-nsis -name "*.exe" -exec cp {} "release-assets/MatchY-windows-setup.exe" \;
find artifacts/windows-msi -name "*.msi" -exec cp {} "release-assets/MatchY-windows.msi" \; 2>/dev/null || true
find artifacts/windows-portable -name "*.zip" -exec cp {} "release-assets/MatchY-windows-portable.zip" \;
find artifacts/windows-cli -name "matchy.exe" -exec cp {} "release-assets/matchy-cli-windows.exe" \;
find artifacts/linux-appimage -name "*.AppImage" -exec cp {} "release-assets/MatchY-linux.AppImage" \;
find artifacts/linux-cli -name "matchy" -exec cp {} "release-assets/matchy-cli-linux" \;
find artifacts/macos-arm-dmg -name "*.dmg" -exec cp {} "release-assets/MatchY-macos.dmg" \;
find artifacts/macos-arm-cli -name "matchy" -exec cp {} "release-assets/matchy-cli-macos" \;
chmod +x release-assets/matchy-cli-linux \
release-assets/matchy-cli-macos
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') || contains(github.ref_name, '-alpha') }}
files: release-assets/*