Skip to content

Commit a629a55

Browse files
committed
fix: serve firmware from Pages to avoid CORS
1 parent 6c3a294 commit a629a55

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ jobs:
4242
- name: Fix permissions
4343
run: sudo chown -R $(id -u):$(id -g) dist
4444

45+
- name: Copy firmware to web-flash
46+
run: |
47+
cp dist/authstick-merged.bin web-flash/authstick-merged.bin
48+
git config user.name "github-actions"
49+
git config user.email "actions@github.com"
50+
git add -f web-flash/authstick-merged.bin
51+
git diff --cached --quiet || git commit -m "release: update firmware binary (${{ github.ref_name }})"
52+
53+
- name: Push to master
54+
run: git push origin master
55+
4556
- uses: softprops/action-gh-release@v2
4657
with:
4758
files: dist/authstick-merged.bin

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ firmware/sdkconfig
55
firmware/sdkconfig.old
66
firmware/dependencies.lock
77

8-
# Merged binary
8+
# Merged binary (except web-flash for Pages deployment)
99
authstick-merged.bin
1010
*.bin
11+
!web-flash/authstick-merged.bin
1112

1213
# Python
1314
__pycache__/

web-flash/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ <h2>浏览器一键烧录<br>无需安装任何工具</h2>
370370
import { ESPLoader, Transport } from
371371
'https://unpkg.com/esptool-js@0.6.0/bundle.js';
372372

373-
const FW_URL = 'https://github.com/whitefirer/authstick/releases/latest/download/authstick-merged.bin';
373+
const FW_URL = 'authstick-merged.bin';
374374
let device, transport, fwData, fwReady = false;
375375

376376
let logFirst = true;

0 commit comments

Comments
 (0)