Skip to content

Commit b748847

Browse files
blinko-spaceclaude
andcommitted
feat: comprehensive build system improvements and workflow optimizations
- Fix React forwardRef errors in production builds with classic JSX runtime - Remove React dependency from icons.tsx to prevent undefined forwardRef - Enable keepNames option in esbuild for better debugging - Lock Bun version to 1.2.8 for consistent local environment - Optimize Tauri build process with explicit frontend building - Fix minification issues in icons.tsx by moving collections object outside function - Add comprehensive test workflow for multi-platform building and artifact uploading - Streamline GitHub Actions workflow and remove redundant build steps - Remove macOS x86 architecture support - Update dependencies across the project 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 45509e0 commit b748847

File tree

9 files changed

+1451
-1211
lines changed

9 files changed

+1451
-1211
lines changed

.github/workflows/app-release.yml

Lines changed: 95 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ on:
1919
description: 'Tag Version (e.g. 1.0.0)'
2020
required: true
2121
type: string
22+
is-test:
23+
description: 'Test Mode (draft release only, no notifications)'
24+
required: false
25+
type: boolean
26+
default: false
27+
disable-all-cache:
28+
description: 'Disable all caches (force clean build)'
29+
required: false
30+
type: boolean
31+
default: false
2232

2333
jobs:
2434
# Set version first
@@ -65,6 +75,7 @@ jobs:
6575
6676
# Update Tauri Config Version
6777
update-version:
78+
if: github.event.inputs.is-test != 'true'
6879
runs-on: ubuntu-latest
6980
needs: set-version
7081
permissions:
@@ -104,17 +115,16 @@ jobs:
104115

105116
# Desktop Platform Build Task
106117
publish-desktop:
107-
needs: [set-version, update-version]
118+
needs: set-version
119+
if: always() && !cancelled() && needs.set-version.result == 'success'
108120
permissions:
109121
contents: write
110122
strategy:
111123
fail-fast: false
112124
matrix:
113125
include:
114-
- platform: 'macos-latest' # Apple M-series chip (ARM)
126+
- platform: 'macos-latest' # Apple Silicon (M-series chip)
115127
args: '--target aarch64-apple-darwin'
116-
- platform: 'macos-latest' # Intel chip Mac
117-
args: '--target x86_64-apple-darwin'
118128
- platform: 'ubuntu-22.04' # Linux Platform
119129
args: ''
120130
- platform: 'windows-latest' # Windows Platform
@@ -126,7 +136,27 @@ jobs:
126136
with:
127137
fetch-depth: 0
128138

129-
- name: Download tauri.conf.json
139+
- name: Show build info (Test Mode)
140+
if: github.event.inputs.is-test == 'true'
141+
shell: bash
142+
run: |
143+
echo "=== TEST MODE BUILD ==="
144+
echo "Branch: $(git branch --show-current)"
145+
echo "Commit: $(git rev-parse --short HEAD)"
146+
echo "Test version: ${{ github.event.inputs.tag }}"
147+
echo "======================"
148+
149+
- name: Update version in tauri.conf.json (Test Mode)
150+
if: github.event.inputs.is-test == 'true'
151+
shell: bash
152+
run: |
153+
# Test mode: update version locally without committing
154+
jq '.version = "${{ needs.set-version.outputs.version }}"' app/src-tauri/tauri.conf.json > tmp.json && mv tmp.json app/src-tauri/tauri.conf.json
155+
echo "Updated version to ${{ needs.set-version.outputs.version }} (test mode, not committed)"
156+
cat app/src-tauri/tauri.conf.json
157+
158+
- name: Download tauri.conf.json (Release Mode)
159+
if: github.event.inputs.is-test != 'true'
130160
uses: actions/download-artifact@v4
131161
with:
132162
name: tauri-config
@@ -170,32 +200,32 @@ jobs:
170200
- name: Install bun
171201
uses: oven-sh/setup-bun@v1
172202
with:
173-
bun-version: latest
203+
bun-version: 1.2.8
174204

175205
- name: Install Rust Stable
176206
uses: dtolnay/rust-toolchain@stable
177207
with:
178208
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
179209

180210
- name: Rust Cache
211+
if: github.event.inputs.disable-all-cache != 'true'
181212
uses: Swatinem/rust-cache@v2
182213
with:
183214
workspaces: app/src-tauri
184215
cache-on-failure: true
185216

186-
- name: Cache Dependencies
187-
uses: actions/cache@v3
188-
with:
189-
path: |
190-
**/node_modules
191-
key: ${{ runner.os }}-modules-${{ hashFiles('**/bun.lockb', '**/package-lock.json') }}
192-
restore-keys: |
193-
${{ runner.os }}-modules-
194-
195217
- name: Install Dependencies
196218
run: |
197-
bun install
198-
cd app && bun install
219+
bun install --frozen-lockfile
220+
221+
- name: Build frontend with Bun (ensure consistent build environment)
222+
shell: bash
223+
run: |
224+
cd app
225+
echo "Building frontend with Bun to ensure consistent minification..."
226+
bun run build:no-pwa
227+
echo "Frontend build completed"
228+
ls -la ../dist/public/ || echo "Build output directory check"
199229
200230
# Using official Tauri Action to build and publish
201231
- name: Build and Publish Desktop App
@@ -206,18 +236,30 @@ jobs:
206236
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
207237
with:
208238
projectPath: 'app'
209-
tauriScript: '../node_modules/.bin/tauri'
239+
beforeBuildCommand: ''
240+
tauriScript: 'bun run tauri'
210241
args: ${{ matrix.args }}
211-
tagName: ${{ needs.set-version.outputs.version }}
212-
releaseName: Blinko ${{ needs.set-version.outputs.version }}
213-
releaseBody: "Under construction, full changelog will be updated after build completion..."
214-
releaseDraft: false
215-
prerelease: false
216-
includeUpdaterJson: true
242+
tagName: ${{ github.event.inputs.is-test == 'true' && '' || needs.set-version.outputs.version }}
243+
releaseName: ${{ github.event.inputs.is-test == 'true' && '' || format('Blinko {0}', needs.set-version.outputs.version) }}
244+
releaseBody: ${{ github.event.inputs.is-test == 'true' && '' || 'Under construction, full changelog will be updated after build completion...' }}
245+
releaseDraft: ${{ github.event.inputs.is-test == 'true' }}
246+
prerelease: ${{ github.event.inputs.is-test == 'true' }}
247+
includeUpdaterJson: ${{ github.event.inputs.is-test != 'true' }}
248+
249+
- name: Upload test artifacts
250+
if: github.event.inputs.is-test == 'true'
251+
uses: actions/upload-artifact@v4
252+
with:
253+
name: blinko-test-${{ matrix.platform }}-${{ github.event.inputs.tag }}
254+
path: |
255+
app/src-tauri/target/release/bundle/**/*
256+
!app/src-tauri/target/release/bundle/**/*.dSYM/**
257+
retention-days: 7
217258

218259
# Android Platform Build Task
219260
publish-android:
220-
needs: [set-version, update-version]
261+
needs: set-version
262+
if: always() && !cancelled() && needs.set-version.result == 'success'
221263
permissions:
222264
contents: write
223265
runs-on: ubuntu-latest
@@ -226,7 +268,16 @@ jobs:
226268
with:
227269
fetch-depth: 0
228270

229-
- name: Download tauri.conf.json
271+
- name: Update version in tauri.conf.json (Test Mode)
272+
if: github.event.inputs.is-test == 'true'
273+
run: |
274+
# Test mode: update version locally without committing
275+
jq '.version = "${{ needs.set-version.outputs.version }}"' app/src-tauri/tauri.conf.json > tmp.json && mv tmp.json app/src-tauri/tauri.conf.json
276+
echo "Updated version to ${{ needs.set-version.outputs.version }} (test mode, not committed)"
277+
cat app/src-tauri/tauri.conf.json
278+
279+
- name: Download tauri.conf.json (Release Mode)
280+
if: github.event.inputs.is-test != 'true'
230281
uses: actions/download-artifact@v4
231282
with:
232283
name: tauri-config
@@ -259,34 +310,26 @@ jobs:
259310
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
260311

261312
- name: Rust Cache
313+
if: github.event.inputs.disable-all-cache != 'true'
262314
uses: Swatinem/rust-cache@v2
263315
with:
264316
workspaces: app/src-tauri
265317
cache-on-failure: true
266318

267-
- name: Cache Dependencies
268-
uses: actions/cache@v3
269-
with:
270-
path: |
271-
**/node_modules
272-
key: ${{ runner.os }}-modules-${{ hashFiles('**/bun.lockb', '**/package-lock.json') }}
273-
restore-keys: |
274-
${{ runner.os }}-modules-
275-
276319
- name: Install bun
277320
uses: oven-sh/setup-bun@v1
278321
with:
279-
bun-version: latest
322+
bun-version: 1.2.8
280323

281324
- name: Install Dependencies
282325
run: |
283-
bun install
284-
cd app && bun install
326+
bun install --frozen-lockfile
285327
286328
- name: Run Prisma Generate
287329
run: bun run prisma:generate
288330

289331
- name: Configure Gradle Cache
332+
if: github.event.inputs.disable-all-cache != 'true'
290333
uses: actions/cache@v3
291334
with:
292335
path: |
@@ -331,16 +374,26 @@ jobs:
331374
echo "Renamed APK file:"
332375
ls -la
333376
334-
- name: Upload Android App to Existing Release
377+
- name: Upload Android App to Release
378+
if: github.event.inputs.is-test != 'true'
335379
uses: softprops/action-gh-release@v1
336380
with:
337381
files: app/src-tauri/gen/android/app/build/outputs/apk/universal/release/Blinko_${{ needs.set-version.outputs.version }}_universal.apk
338382
tag_name: ${{ needs.set-version.outputs.version }}
339383
env:
340384
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
341385

386+
- name: Upload Android APK as artifact (Test Mode)
387+
if: github.event.inputs.is-test == 'true'
388+
uses: actions/upload-artifact@v4
389+
with:
390+
name: blinko-test-android-${{ needs.set-version.outputs.version }}
391+
path: app/src-tauri/gen/android/app/build/outputs/apk/universal/release/Blinko_${{ needs.set-version.outputs.version }}_universal.apk
392+
retention-days: 7
393+
342394
# Generate changelog after all builds are complete
343395
generate-changelog:
396+
if: github.event.inputs.is-test != 'true'
344397
runs-on: ubuntu-latest
345398
needs: [set-version, publish-desktop, publish-android]
346399
outputs:
@@ -363,6 +416,7 @@ jobs:
363416

364417
# Update release with final changelog
365418
update-release:
419+
if: github.event.inputs.is-test != 'true'
366420
runs-on: ubuntu-latest
367421
needs: [set-version, generate-changelog]
368422
permissions:
@@ -380,6 +434,7 @@ jobs:
380434

381435
# Process notification content with AI
382436
process-notification:
437+
if: github.event.inputs.is-test != 'true'
383438
runs-on: ubuntu-latest
384439
needs: [set-version, generate-changelog]
385440
outputs:
@@ -476,6 +531,7 @@ jobs:
476531
477532
# Send notification to Telegram groups
478533
notify-telegram:
534+
if: github.event.inputs.is-test != 'true'
479535
runs-on: ubuntu-latest
480536
needs: [set-version, update-release, generate-changelog, process-notification]
481537
steps:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ dev-dist
3131
.claudeconfig
3232
.claude/*
3333
.claude/settings.local.json
34-
target
34+
target
35+
server/public

app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"build:web": "NODE_OPTIONS=\"--max-old-space-size=4096\" vite build",
1313
"tauri": "tauri",
1414
"tauri:dev": "RUST_BACKTRACE=1 tauri dev",
15+
"tauri:build:desktop:local": "tauri build --no-bundle",
1516
"tauri:android:dev": "tauri android dev --host",
1617
"tauri:android:build": "tauri android build",
1718
"tauri:desktop:build": "tauri build",

0 commit comments

Comments
 (0)