-
-
Notifications
You must be signed in to change notification settings - Fork 62
171 lines (141 loc) · 4.61 KB
/
release-web.yml
File metadata and controls
171 lines (141 loc) · 4.61 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
name: Publish Web Packages
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
VITE_REDIRECT_URL: ${{ secrets.VITE_REDIRECT_URL }}
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
jobs:
publish-web-linux:
permissions:
contents: write
env:
PKG_CONFIG_ALLOW_CROSS: "1"
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
arch: x86_64
libc: gnu
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v5
- name: setup node
uses: actions/setup-node@v6
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "src-tauri"
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: bun install
- name: Package web
run: |
WEB_TARGET_TRIPLE="${{ matrix.target }}" \
WEB_ARCH="${{ matrix.arch }}" \
WEB_LIBC="${{ matrix.libc }}" \
bash scripts/package-web.sh
- name: Resolve package path
shell: bash
run: |
version="$(node -e "console.log(require('./package.json').version)")"
package_path="/tmp/codexia-web-${version}-linux-${{ matrix.arch }}-${{ matrix.libc }}.tar.gz"
echo "WEB_PACKAGE_PATH=${package_path}" >> "$GITHUB_ENV"
- name: Upload web package to release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.WEB_PACKAGE_PATH }}
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-web-macos:
permissions:
contents: write
runs-on: macos-latest
env:
NODE_OPTIONS: --max-old-space-size=4096
# if: false # Temporarily disabled
steps:
- uses: actions/checkout@v5
- name: setup node
uses: actions/setup-node@v6
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "src-tauri"
- name: install frontend dependencies
run: bun install
- name: Package web
run: |
WEB_TARGET_TRIPLE="aarch64-apple-darwin" \
WEB_ARCH="aarch64" \
bash scripts/package-web.sh
- name: Resolve package path
shell: bash
run: |
version="$(node -e "console.log(require('./package.json').version)")"
package_path="/tmp/codexia-web-${version}-darwin-aarch64.tar.gz"
echo "WEB_PACKAGE_PATH=${package_path}" >> "$GITHUB_ENV"
- name: Upload web package to release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.WEB_PACKAGE_PATH }}
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-web-windows:
permissions:
contents: write
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: setup node
uses: actions/setup-node@v6
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "src-tauri"
- name: install frontend dependencies
run: bun install
- name: Package web for Windows
shell: cmd
run: scripts\package-web.bat
- name: Resolve package path
shell: pwsh
run: |
$version = (Get-Content -Raw package.json | ConvertFrom-Json).version
$path = Join-Path $env:TEMP "codexia-web-$version-windows-x86_64.zip"
"WEB_PACKAGE_PATH=$path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload web package to release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.WEB_PACKAGE_PATH }}
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}