Skip to content

Commit 2c2a282

Browse files
author
Anaïs Saraiva
committed
Update build.yml
1 parent 6c44fdf commit 2c2a282

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
args: ''
1818
- platform: 'windows-latest'
1919
args: ''
20+
- platform: 'macos-latest'
21+
args: '--target universal-apple-darwin'
2022

2123
runs-on: ${{ matrix.platform }}
2224
steps:
@@ -47,6 +49,13 @@ jobs:
4749
powershell -c "irm bun.sh/install.ps1 | iex"
4850
echo "$env:USERPROFILE\.bun\bin" >> $env:GITHUB_PATH
4951
52+
- name: Install Bun (macOS)
53+
if: matrix.platform == 'macos-latest'
54+
run: |
55+
curl -fsSL https://bun.sh/install | bash
56+
echo "$HOME/.bun/bin" >> $GITHUB_PATH
57+
source ~/.bashrc
58+
5059
- name: install frontend dependencies (Linux)
5160
if: matrix.platform == 'ubuntu-22.04'
5261
run: |
@@ -62,8 +71,17 @@ jobs:
6271
if (Test-Path package-lock.json) { Remove-Item -Force package-lock.json }
6372
npm install
6473
74+
- name: install frontend dependencies (macOS)
75+
if: matrix.platform == 'macos-latest'
76+
run: |
77+
npm cache clean --force
78+
rm -rf node_modules package-lock.json
79+
npm install
80+
6581
- name: install Rust stable
6682
uses: dtolnay/rust-toolchain@stable
83+
with:
84+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
6785

6886
- name: Rust cache
6987
uses: swatinem/rust-cache@v2
@@ -80,6 +98,11 @@ jobs:
8098
run: |
8199
npm install @rollup/rollup-win32-x64-msvc --save-dev
82100
101+
- name: install missing rollup dependencies (macOS)
102+
if: matrix.platform == 'macos-latest'
103+
run: |
104+
npm install @rollup/rollup-darwin-x64 --save-dev
105+
83106
- name: install Tauri CLI (Rust version)
84107
run: cargo install tauri-cli --locked
85108

@@ -97,6 +120,8 @@ jobs:
97120
src-tauri/target/release/bundle/appimage/*.AppImage
98121
src-tauri/target/release/bundle/msi/*.msi
99122
src-tauri/target/release/bundle/nsis/*.exe
123+
src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
124+
src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
100125
retention-days: 30
101126

102127
- name: create release
@@ -112,11 +137,14 @@ jobs:
112137
- `.AppImage` for generic Linux
113138
- `.msi` for Windows (installer)
114139
- `.exe` for Windows (NSIS installer)
140+
- `.dmg` for macOS (universal binary)
115141
files: |
116142
src-tauri/target/release/bundle/deb/*.deb
117143
src-tauri/target/release/bundle/appimage/*.AppImage
118144
src-tauri/target/release/bundle/msi/*.msi
119145
src-tauri/target/release/bundle/nsis/*.exe
146+
src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
147+
src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
120148
draft: false
121149
prerelease: false
122150
env:

0 commit comments

Comments
 (0)