-
Notifications
You must be signed in to change notification settings - Fork 2
187 lines (160 loc) · 6.6 KB
/
Copy pathrelease.yml
File metadata and controls
187 lines (160 loc) · 6.6 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
validate-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate version consistency
run: |
# Extract version from git tag (strip 'v' prefix)
TAG_VERSION="${GITHUB_REF_NAME#v}"
echo "Git tag version: $TAG_VERSION"
# Extract version from package.json
PKG_VERSION=$(node -p "require('./package.json').version")
echo "package.json version: $PKG_VERSION"
# Extract version from tauri.conf.json
TAURI_VERSION=$(node -p "require('./apps/desktop/src-tauri/tauri.conf.json').version")
echo "tauri.conf.json version: $TAURI_VERSION"
# Extract version from desktop Cargo.toml
CARGO_VERSION=$(grep -m1 '^version' apps/desktop/src-tauri/Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "desktop Cargo.toml version: $CARGO_VERSION"
# Extract version from server Cargo.toml
SERVER_VERSION=$(grep -m1 '^version' server/Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "server Cargo.toml version: $SERVER_VERSION"
# Check all versions match
MISMATCH=0
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "❌ ERROR: Git tag ($TAG_VERSION) doesn't match package.json ($PKG_VERSION)"
MISMATCH=1
fi
if [ "$TAG_VERSION" != "$TAURI_VERSION" ]; then
echo "❌ ERROR: Git tag ($TAG_VERSION) doesn't match tauri.conf.json ($TAURI_VERSION)"
MISMATCH=1
fi
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
echo "❌ ERROR: Git tag ($TAG_VERSION) doesn't match desktop Cargo.toml ($CARGO_VERSION)"
MISMATCH=1
fi
if [ "$TAG_VERSION" != "$SERVER_VERSION" ]; then
echo "❌ ERROR: Git tag ($TAG_VERSION) doesn't match server Cargo.toml ($SERVER_VERSION)"
MISMATCH=1
fi
if [ $MISMATCH -eq 1 ]; then
echo ""
echo "💡 Fix: Update all version files to match your git tag, or create a new tag matching your versions."
exit 1
fi
echo "✅ All versions match: $TAG_VERSION"
publish-tauri:
needs: validate-version
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
rust_target: 'aarch64-apple-darwin'
- platform: 'macos-13'
args: '--target x86_64-apple-darwin'
rust_target: 'x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
rust_target: ''
- platform: 'windows-latest'
args: ''
rust_target: ''
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
server -> target
apps/desktop/src-tauri -> target
- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Build frontend
run: pnpm run build:web
- name: Build server sidecar
run: pnpm run build:server --release ${{ matrix.rust_target && format('-- --target {0}', matrix.rust_target) || '' }}
- name: Build Tauri app (Linux)
if: matrix.platform == 'ubuntu-22.04'
run: pnpm --filter @spiritstream/desktop tauri build
- name: Upload Linux artifacts
if: matrix.platform == 'ubuntu-22.04'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: 'SpiritStream ${{ github.ref_name }}'
body: |
## SpiritStream ${{ github.ref_name }}
### Downloads
Choose the appropriate download for your platform:
- **macOS (Apple Silicon)**: `.dmg` file ending in `aarch64`
- **macOS (Intel)**: `.dmg` file ending in `x64`
- **Windows**: `.msi` or `.exe` installer
- **Linux**: `.AppImage` or `.deb` package
### Requirements
- **FFmpeg** is required for streaming functionality
- macOS: `brew install ffmpeg`
- Windows: Download from [ffmpeg.org](https://ffmpeg.org/download.html)
- Linux: `sudo apt install ffmpeg`
draft: true
prerelease: false
files: |
apps/desktop/src-tauri/target/release/bundle/deb/SpiritStream_*_amd64.deb
apps/desktop/src-tauri/target/release/bundle/rpm/SpiritStream-*-1.x86_64.rpm
apps/desktop/src-tauri/target/release/bundle/appimage/SpiritStream_*_amd64.AppImage
- name: Build and release
if: matrix.platform != 'ubuntu-22.04'
uses: tauri-apps/tauri-action@v0.5.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: apps/desktop
tauriScript: pnpm tauri
tagName: ${{ github.ref_name }}
releaseName: 'SpiritStream ${{ github.ref_name }}'
releaseBody: |
## SpiritStream ${{ github.ref_name }}
### Downloads
Choose the appropriate download for your platform:
- **macOS (Apple Silicon)**: `.dmg` file ending in `aarch64`
- **macOS (Intel)**: `.dmg` file ending in `x64`
- **Windows**: `.msi` or `.exe` installer
- **Linux**: `.AppImage` or `.deb` package
### Requirements
- **FFmpeg** is required for streaming functionality
- macOS: `brew install ffmpeg`
- Windows: Download from [ffmpeg.org](https://ffmpeg.org/download.html)
- Linux: `sudo apt install ffmpeg`
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}