Skip to content

Commit d0cc15c

Browse files
committed
ci: fix release workflow - add rust-cache, fix linux deps, fix macos universal target
1 parent a8f4375 commit d0cc15c

1 file changed

Lines changed: 22 additions & 40 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ jobs:
1212
matrix:
1313
include:
1414
- platform: windows-latest
15-
args: '--target x86_64-pc-windows-msvc'
15+
rust-targets: ''
16+
tauri-args: ''
1617
- platform: macos-latest
17-
args: '--target aarch64-apple-darwin --target x86_64-apple-darwin'
18+
rust-targets: 'aarch64-apple-darwin,x86_64-apple-darwin'
19+
tauri-args: '--target universal-apple-darwin'
1820
- platform: ubuntu-22.04
19-
args: ''
21+
rust-targets: ''
22+
tauri-args: ''
2023

2124
runs-on: ${{ matrix.platform }}
2225

@@ -28,49 +31,31 @@ jobs:
2831
with:
2932
node-version: 20
3033

31-
- name: Install Rust
34+
- name: Install Rust stable
3235
uses: dtolnay/rust-toolchain@stable
3336
with:
34-
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
37+
targets: ${{ matrix.rust-targets }}
3538

36-
- name: Install Linux dependencies
39+
- name: Rust cache
40+
uses: swatinem/rust-cache@v2
41+
with:
42+
workspaces: './src-tauri -> target'
43+
44+
- name: Install Linux system dependencies
3745
if: matrix.platform == 'ubuntu-22.04'
3846
run: |
3947
sudo apt-get update
40-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
48+
sudo apt-get install -y \
49+
libwebkit2gtk-4.1-dev \
50+
libappindicator3-dev \
51+
librsvg2-dev \
52+
patchelf \
53+
libxdo-dev
4154
4255
- name: Install frontend dependencies
43-
run: npm install
44-
45-
- name: Build Tauri app (macOS universal)
46-
if: matrix.platform == 'macos-latest'
47-
uses: tauri-apps/tauri-action@v0
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
with:
51-
tagName: ${{ github.ref_name }}
52-
releaseName: 'Memory Forge ${{ github.ref_name }}'
53-
releaseBody: |
54-
## Memory Forge ${{ github.ref_name }}
55-
56-
### 下载 / Download
57-
58-
| 平台 | 文件 | 说明 |
59-
|------|------|------|
60-
| Windows | `*_x64-setup.exe` | 安装包(推荐) |
61-
| Windows | `*_x64_en-US.msi` | MSI 安装包 |
62-
| macOS | `*_universal.dmg` | 通用版(Intel + Apple Silicon) |
63-
| Linux | `*_amd64.AppImage` | 免安装,双击运行 |
64-
| Linux | `*_amd64.deb` | Debian/Ubuntu 安装包 |
65-
66-
### 更新内容
67-
See [CHANGELOG](https://github.com/voidcraft-dev/memory-forge-rs/commits/main) for details.
68-
releaseDraft: false
69-
prerelease: false
70-
args: --target universal-apple-darwin
56+
run: npm ci
7157

7258
- name: Build Tauri app
73-
if: matrix.platform != 'macos-latest'
7459
uses: tauri-apps/tauri-action@v0
7560
env:
7661
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -89,9 +74,6 @@ jobs:
8974
| macOS | `*_universal.dmg` | 通用版(Intel + Apple Silicon) |
9075
| Linux | `*_amd64.AppImage` | 免安装,双击运行 |
9176
| Linux | `*_amd64.deb` | Debian/Ubuntu 安装包 |
92-
93-
### 更新内容
94-
See [CHANGELOG](https://github.com/voidcraft-dev/memory-forge-rs/commits/main) for details.
9577
releaseDraft: false
9678
prerelease: false
97-
args: ${{ matrix.args }}
79+
args: ${{ matrix.tauri-args }}

0 commit comments

Comments
 (0)