Skip to content

Commit 4f1766d

Browse files
committed
ci(release): 恢復 v* tag push 自動觸發,補 alpha.63 changelog
自動觸發是恢復不是新增:source 還 private 時 Actions 額度有限才改成手動 dispatch,2026-06 轉 public 後額度免費卻沒改回來——而 Windows/Linux 產物 只有這條路徑產得出來。workflow_dispatch 保留供重跑失敗的 tag。 順帶修掉一個既有隱患:兩個 checkout 都沒指定 ref,會抓預設分支而非 tag。 tauri-action 用 inputs.tag 命名 release,所以舊 tag 重跑會把新 main 的 程式碼打上舊版號。現已 checkout ref: inputs.tag || github.ref_name。 RELEASING.md 同步更新(原本寫「不再自動觸發」,已成假話),並標明 release-local.sh 降為 fallback、不可與 CI 同時對同一 tag 執行 (它會 --draft=false,在 Windows/Linux 上傳完前就發佈 → 正是 v0.1.0-alpha.54 partial latest.json 的成因)。
1 parent 3615659 commit 4f1766d

3 files changed

Lines changed: 86 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
name: Release
22

3-
# Manual (workflow_dispatch) only — a deliberate choice, not a cost concern. The
4-
# repo is public so GitHub Actions is free, but we don't want every tag push to
5-
# kick off a 4-platform build. The default path is the local macOS release
6-
# script (`scripts/release-local.sh`); use this workflow when you want CI to
7-
# build/publish a tagged release directly on this repo (notably the
8-
# Windows/Linux artifacts the mac-only local script can't produce).
3+
# Runs automatically on every `v*` tag push, building and publishing all four
4+
# platforms (macOS arm64 + x86_64, Linux, Windows). This repo is public, so
5+
# Actions minutes are free — the earlier manual-only design was a deliberate
6+
# "don't build 4 platforms on every tag" choice, which the operator revisited
7+
# (2026-07-16): the Windows/Linux artifacts are the point, and dispatching by
8+
# hand every time was the thing actually costing something.
9+
#
10+
# `workflow_dispatch` is kept for re-running a tag whose build failed, or for
11+
# releasing an old tag.
12+
#
13+
# ⚠ `scripts/release-local.sh` is now REDUNDANT for a normal release, and must
14+
# NOT be run for a tag this workflow is already building: it does
15+
# `gh release edit --draft=false`, which would publish the release before the
16+
# Windows/Linux jobs have uploaded — exactly the partial-`latest.json` failure
17+
# (v0.1.0-alpha.54) that the draft-until-all-platforms-finish design below
18+
# exists to prevent. Keep the script for the case CI can't cover (e.g. Actions
19+
# down, or a mac-only hotfix).
920
on:
21+
push:
22+
tags:
23+
- 'v*'
1024
workflow_dispatch:
1125
inputs:
1226
tag:
1327
description: 'Tag to release (e.g. v0.1.0-alpha.7)'
1428
required: true
1529

16-
# Re-dispatching the same tag cancels the previous in-flight run so we don't
17-
# build the same release twice.
30+
# The tag being released is `inputs.tag || github.ref_name` throughout: on a tag
31+
# push `inputs` is empty so the fallback picks the pushed ref; on a manual
32+
# dispatch the input wins. The expression is repeated rather than hoisted into
33+
# workflow-level `env` because `concurrency` below can't read the `env` context.
34+
35+
# Re-dispatching (or re-pushing) the same tag cancels the previous in-flight run
36+
# so we don't build the same release twice.
1837
concurrency:
19-
group: release-${{ inputs.tag }}
38+
group: release-${{ inputs.tag || github.ref_name }}
2039
cancel-in-progress: true
2140

2241
permissions:
@@ -31,10 +50,15 @@ jobs:
3150
outputs:
3251
body: ${{ steps.extract.outputs.body }}
3352
steps:
53+
# Read CHANGELOG.md as it was AT THE TAG, not at the default branch —
54+
# otherwise a manual dispatch of an old tag would splice in notes main has
55+
# since edited.
3456
- uses: actions/checkout@v4
57+
with:
58+
ref: ${{ inputs.tag || github.ref_name }}
3559
- id: extract
3660
env:
37-
TAG: ${{ inputs.tag }}
61+
TAG: ${{ inputs.tag || github.ref_name }}
3862
run: |
3963
VERSION="${TAG#v}"
4064
{
@@ -78,8 +102,13 @@ jobs:
78102
runs-on: ${{ startsWith(matrix.platform, 'macos') && (vars.MACOS_RUNNER || 'macos-latest') || matrix.platform }}
79103

80104
steps:
105+
# Build the tag's source, not the default branch's. Without this the
106+
# artifacts would be whatever main happens to hold while carrying the
107+
# tag's name — silently shipping unreleased code under a released version.
81108
- name: Checkout
82109
uses: actions/checkout@v4
110+
with:
111+
ref: ${{ inputs.tag || github.ref_name }}
83112

84113
- name: Setup Node
85114
uses: actions/setup-node@v4
@@ -138,8 +167,8 @@ jobs:
138167
# leave this unset, which disables sync instead of hardcoding a relay.
139168
VITE_NORTHSTAR_SYNC_WORKER_URL: ${{ vars.NORTHSTAR_SYNC_WORKER_URL }}
140169
with:
141-
tagName: ${{ inputs.tag }}
142-
releaseName: Northstar ${{ inputs.tag }}
170+
tagName: ${{ inputs.tag || github.ref_name }}
171+
releaseName: Northstar ${{ inputs.tag || github.ref_name }}
143172
releaseBody: |
144173
${{ needs.notes.outputs.body }}
145174
@@ -186,7 +215,7 @@ jobs:
186215
- name: Publish the completed draft release
187216
env:
188217
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189-
TAG: ${{ inputs.tag }}
218+
TAG: ${{ inputs.tag || github.ref_name }}
190219
run: |
191220
set -euo pipefail
192221
release_id=$(gh api "repos/${GITHUB_REPOSITORY}/releases" --paginate \

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
All notable changes to Northstar will be documented in this file.
44

5+
## [0.1.0-alpha.63] - 2026-07-16
6+
7+
### Added
8+
- **帳本可刪除**:帳戶頁的「帳本管理」每一列新增刪除按鈕。帳本裡還有帳戶、發票或客戶時會擋下並說明原因(請先把它們移到其他帳本),最後一個個人帳本不能刪除。刪除會同步到其他裝置。
9+
- **總覽的提示可以關閉**:頂端的「資料健康」與「超支」兩條提示可以關掉,之後只有在**情況真的改變**時才會再出現——例如換月、或另一個分類也超支。同一個分類的金額變動不會重複打擾你。
10+
11+
### Changed
12+
- **帳戶頁改用與投資頁一致的視覺**:總資產/總負債/淨值三張卡片改為單一橫條(與投資頁的 KPI 條同款),下方的幣別卡片格改為配置條+圖例。金額維持完整位數,方便一眼核對「總資產 − 總負債 = 淨值」。
13+
- **刪除動作有了統一的視覺語言**:全 app 的刪除按鈕改用 destructive 樣式。**記帳頁的刪除按鈕過去與編輯按鈕外觀完全相同**,現在有明確區隔。刪除確認的用字統一為「確定刪除」。
14+
- **對話框關閉鈕統一**:15 處關閉鈕改用同一個元件,全部具備 tooltip 與無障礙標籤。iOS 上的觸控區域補足到 44pt——手機「更多」面板的關閉鈕原本沒有可點區塊,只是一個裸的圖示。
15+
16+
### Fixed
17+
- **帳本切換器打不開**:側欄的「總帳」下拉選單被側欄本身蓋住,點了像是沒反應。
18+
- **系統重複建立的「個人帳」會自動合併**:多裝置同步時,每台裝置在第一次啟動(早於首次同步)各自建立自己的預設「個人帳」,造成重複、且每多一台裝置就多一本。現在同步後會自動合併並顯示提示。**只合併系統自動建立且從未編輯過的帳本——你自己建立或改過名稱/設定的帳本永遠不會被自動合併。**
19+
- **投資列表的「編輯持倉」補回價格檢視**:從投資列表開啟的編輯視窗缺少 Yahoo 每日報價檢視與自動/手動切換,從持倉詳情開啟的卻有——同一顆按鈕、兩種功能。現已統一為同一個視窗。
20+
- **淨值增減的漲跌配色**:在「紅漲綠跌(台股)」模式下,總覽的淨值變動維持綠色,與正下方紅色的「投資今日」互相矛盾(兩者描述同一天、且淨值變動幾乎全由投資變動組成)。淨值變動現已歸類為行情數字,跟隨盈虧配色設定。
21+
- **總覽 AI 摘要的排版**:摘要擠在標題列左側、換行破碎、重新產生鈕浮在文字旁,現改為獨立的整列。
22+
- **手機版 KPI 橫條無法左右滑動**:帳戶頁與投資頁的 KPI 橫條在手機上垂直堆疊,設計中的橫向滑動與吸附失效。
23+
524
## [0.1.0-alpha.61] - 2026-07-14
625

726
### Added

RELEASING.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
> 已移除。以下提到 private repo、`northstar-releases` mirror、`RELEASES_TOKEN` 的段落為
66
> 過渡期歷史說明,待現有安裝完成遷移後再整併。
77
8-
Northstar 目前以**本地 macOS release** 為主要發版流程;GitHub Actions release workflow 保留為**手動 fallback**,不再因為 push `v*` tag 自動觸發。
8+
Northstar 以 **GitHub Actions release workflow** 為主要發版流程:push `v*` tag 就會自動建置並
9+
發布四個平台(macOS arm64/Intel、Linux、Windows)。
10+
11+
> **沿革(2026-07-16)**:自動觸發是恢復、不是新增。source repo 還是 private 時 Actions 額度
12+
> 有限,因此改成手動 dispatch;2026-06 轉 public 後額度已免費,但沒有跟著改回來,導致每次
13+
> 發版都得手動 dispatch,而 Windows/Linux 產物只有這條路徑產得出來。現已恢復自動。
14+
15+
`scripts/release-local.sh`(本地 macOS build)降為 **CI 不可用時的 fallback**,且**不可**與 CI
16+
同時對同一個 tag 執行——見第 4 步的警告。
917

1018
## 為什麼有兩個 repo?(重要)
1119

@@ -78,23 +86,31 @@ git tag v0.1.0-alpha.7
7886
git push && git push --tags
7987
```
8088

81-
推上 source commit 與 tag 後,版本對應的原始碼就固定下來了;**不會**自動觸發 GitHub Actions release。
89+
**推上 tag 就會自動觸發 Release workflow**(2026-07-16 起)。它會在 CI 上建置並簽署四個平台
90+
(macOS arm64/Intel、Linux、Windows),全部上傳完成後才把 draft release 翻成正式版。
91+
到這一步就沒事了,直接跳到第 5 步驗收。
92+
93+
> 建置期間 release 維持 draft,`releases/latest` 仍指向前一版,所以 updater 只會回報
94+
> 「已是最新」,不會拿到只有部分平台的 `latest.json`(v0.1.0-alpha.54 的教訓)。
95+
96+
### 4.(僅在 CI 無法使用時)本地 release 腳本
8297

83-
### 4. 執行本地 release 腳本
98+
**一般情況不需要這一步,第 3 步的 CI 已經涵蓋。**
8499

85100
```bash
86101
./scripts/release-local.sh v0.1.0-alpha.7
87102
```
88103

89-
此腳本會:
104+
**不要對 CI 正在建置的 tag 執行這支腳本。** 它會 `gh release edit --draft=false`,在
105+
Windows/Linux 還沒上傳完就把 release 發佈出去——正是第 3 步的 draft 設計要防的那個
106+
partial `latest.json` 問題。只有在 CI 不可用(Actions 掛掉、或只需 mac 的緊急修補)時才用它,
107+
且要確認沒有 CI run 正在跑同一個 tag。
90108

91-
1. 在本機建置並簽署 universal macOS 版本
92-
2. 產生指向 public repo 的 `latest.json`
93-
3. 建立或更新 public `northstar-releases` 上對應 tag 的 GitHub Release
109+
此腳本只產出 macOS(universal),Windows/Linux 仍得靠 CI。
94110

95-
### 5. 確認 public release
111+
### 5. 確認 release
96112

97-
前往 [northstar-releases Releases](https://github.com/larryjclai/northstar-releases/releases)
113+
前往 [northstar Releases](https://github.com/larryjclai/northstar/releases)
98114

99115
1. 確認該 tag 的 artifacts 都已上傳(`.dmg``.msi``.exe``.deb``.AppImage`、各 `.sig``latest.json`
100116
2. 確認它被標為 **Latest**(updater 靠 `releases/latest` 解析)

0 commit comments

Comments
 (0)