-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.4 KB
/
Copy pathbuild.yml
File metadata and controls
75 lines (63 loc) · 2.4 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
name: Build & Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install frontend dependencies
run: npm install
- name: Generate macOS icons from ICO
if: matrix.os == 'macos-latest'
run: |
brew install imagemagick
magick src-tauri/icons/icon.ico -resize 512x512 -background none -alpha on -type TrueColorAlpha PNG32:src-tauri/icons/icon.png
mkdir -p src-tauri/icons/icon.iconset
for size in 16 32 64 128 256 512; do
magick src-tauri/icons/icon.ico -resize ${size}x${size} -background none -alpha on -type TrueColorAlpha PNG32:src-tauri/icons/icon.iconset/icon_${size}x${size}.png
double=$((size * 2))
magick src-tauri/icons/icon.ico -resize ${double}x${double} -background none -alpha on -type TrueColorAlpha PNG32:src-tauri/icons/icon.iconset/icon_${size}x${size}@2x.png
done
iconutil -c icns src-tauri/icons/icon.iconset -o src-tauri/icons/icon.icns
- name: Build Tauri app (Windows)
if: matrix.os == 'windows-latest'
run: npx tauri build --target ${{ matrix.target }}
- name: Build Tauri app (macOS)
if: matrix.os == 'macos-latest'
run: npx tauri build --target ${{ matrix.target }} --bundles app
- name: Prepare Windows artifact
if: matrix.os == 'windows-latest'
shell: bash
run: cp "src-tauri/target/${{ matrix.target }}/release/yauz.exe" "yauz-windows-x64.exe"
- name: Prepare macOS artifact
if: matrix.os == 'macos-latest'
run: |
cd "src-tauri/target/${{ matrix.target }}/release/bundle/macos"
zip -r "$GITHUB_WORKSPACE/YAUZ-macos-arm64.zip" YAUZ.app
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: |
yauz-windows-x64.exe
YAUZ-macos-arm64.zip