forked from elizaOS/eliza
-
Notifications
You must be signed in to change notification settings - Fork 5
150 lines (129 loc) · 4.68 KB
/
tauri-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
name: Release Native App
on:
release:
types: [created, edited, published, prereleased]
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true # Enforces remote-only caching
TURBO_CACHE: remote:rw # allow r/w to remote cache
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Skip binary downloads during install
YOUTUBE_DL_SKIP_DOWNLOAD: true
ADBLOCK: true
PUPPETEER_SKIP_DOWNLOAD: true
CYPRESS_INSTALL_BINARY: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
jobs:
build-and-publish:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
include:
- platform: macos-latest
target: universal-apple-darwin
output-dir: src-tauri/target/universal-apple-darwin/release/bundle/dmg
asset-suffix: _universal.dmg
- platform: ubuntu-latest
target: x86_64-unknown-linux-gnu
output-dir: src-tauri/target/release/bundle
asset-suffix: _amd64
# - platform: windows-latest
# target: x86_64-pc-windows-msvc
# output-dir: src-tauri/target/release/bundle/nsis
# asset-suffix: _x64-setup.exe
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '23'
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Setup Rust
run: |
rustup update stable
rustup default stable
rustup target add ${{ matrix.target }}
shell: bash
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './packages/app/src-tauri -> target'
key: ${{ matrix.target }}
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev libx11-dev libxdo-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Install dependencies (mac only - for universal builds)
if: matrix.platform == 'macos-latest'
run: |
rustup target add aarch64-apple-darwin
- name: Create .npmrc to skip postinstall scripts
run: |
echo "ignore-scripts=true" > .npmrc
shell: bash
- name: Install dependencies
run: bun install --no-postinstall
env:
NPM_CONFIG_IGNORE_SCRIPTS: true
- name: Build packages
run: bun run build
- name: Install Tauri CLI
run: |
bun install -g @tauri-apps/cli
shell: bash
- name: Build the app (macOS)
if: matrix.platform == 'macos-latest'
run: |
cd packages/app
bun run tauri build --target universal-apple-darwin
- name: Build the app (non-macOS)
if: matrix.platform != 'macos-latest'
run: |
cd packages/app
bun run tauri build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: tauri-artifacts-${{ matrix.platform }}
path: packages/app/${{ matrix.output-dir }}
if-no-files-found: error
# Special handling for Linux since it produces multiple artifacts
- name: Collect Linux artifacts
if: matrix.platform == 'ubuntu-latest'
run: |
mkdir -p ./release-artifacts
cp packages/app/src-tauri/target/release/bundle/appimage/*.AppImage ./release-artifacts/ || echo "No AppImage found"
cp packages/app/src-tauri/target/release/bundle/deb/*.deb ./release-artifacts/ || echo "No deb file found"
- name: Upload Linux artifacts
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: linux-specific-artifacts
path: ./release-artifacts
if-no-files-found: warn
- name: Create GitHub release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
packages/app/${{ matrix.output-dir }}/**/*
./release-artifacts/*
draft: ${{ github.event_name == 'push' }}
prerelease: ${{ github.event.release.prerelease }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}