Skip to content

Commit 2c47c5f

Browse files
committed
chore: streamline publish pipeline with validate gate
publish.yml: validate job (analyze, format, test) must pass before reusable dart-lang/setup-dart publish workflow runs. Trigger on tag push for pub.dev OIDC compatibility. release.md: removed separate CI wait phase — publish.yml now handles validation internally via the validate job.
1 parent 2207f5d commit 2c47c5f

2 files changed

Lines changed: 30 additions & 25 deletions

File tree

.claude/commands/release.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Prepare a new release — bumps version, updates changelog, syncs docs, waits for CI, creates GitHub Release (which triggers pub.dev publish).
2+
description: Prepare a new release — bumps version, updates changelog, syncs docs, creates GitHub Release which triggers validate + publish to pub.dev.
33
---
44

55
## Context
@@ -71,39 +71,21 @@ Run all checks locally. ALL must pass before proceeding:
7171
4. `dart pub publish --dry-run` — must be zero warnings
7272
5. Review all changed files with `git diff`
7373

74-
If **dry-run fails** → STOP. Fix the issue before proceeding. The dry-run catches the same errors that pub.dev OIDC publish would catch.
74+
If **dry-run fails** → STOP. Fix the issue before proceeding.
7575

7676
### Phase 6: Commit & Push
7777

7878
1. Stage all modified files
7979
2. Create a single commit: `chore(release): {version}`
8080
3. Push to remote: `git push`
8181

82-
### Phase 7: Wait for CI
82+
### Phase 7: Create GitHub Release
8383

84-
The push triggers the **Lint & Test** workflow (`deploy.yml`) on GitHub. Wait for it to pass before creating the release.
85-
86-
1. Get the run ID for the push commit:
87-
```bash
88-
gh run list --branch v1 --limit 1 --json databaseId,status,conclusion --jq '.[0]'
89-
```
90-
91-
2. Wait for CI to complete:
92-
```bash
93-
gh run watch {run_id} --exit-status
94-
```
95-
96-
3. Evaluate:
97-
- **CI passed** → proceed to Phase 8
98-
- **CI failed** → STOP. Report the failure. Run `gh run view {run_id} --log-failed` to show the error. Do NOT create the release. The user must fix the issue and re-run `/release`.
99-
100-
### Phase 8: Create GitHub Release
101-
102-
CI is green. Create a GitHub Release using `gh` CLI. This does three things at once:
84+
Create a GitHub Release using `gh` CLI. This triggers the full pipeline at once:
10385

10486
1. **Creates the GitHub Release** with changelog notes
10587
2. **Creates the git tag** (e.g. `1.0.0-alpha.4`)
106-
3. **Triggers `publish.yml`**the tag push activates the pub.dev OIDC publish workflow
88+
3. **Triggers `publish.yml`** — tag push starts the `validate` job (analyze + format + test), then `publish` job (dry-run + publish to pub.dev via OIDC)
10789

10890
Determine if the version is a prerelease:
10991
- Contains `alpha` or `beta` or `rc` → add `--prerelease` flag
@@ -153,6 +135,5 @@ Present a summary:
153135
**Changelog:** {count} features, {count} fixes, {count} improvements
154136
155137
**Local:** ✅ Tests ({count} passed) · ✅ Analyzer (0 issues) · ✅ Format clean · ✅ Dry-run (0 warnings)
156-
**CI:** ✅ Lint & Test passed (run #{run_id})
157-
**pub.dev:** ✅ Published (run #{publish_run_id}) — https://pub.dev/packages/fluttersdk_wind
138+
**pub.dev:** ✅ Validate passed → Published (run #{publish_run_id}) — https://pub.dev/packages/fluttersdk_wind
158139
```

.github/workflows/publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,31 @@ on:
66
- '[0-9]+.[0-9]+.[0-9]+*'
77

88
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Flutter
15+
uses: subosito/flutter-action@v2
16+
with:
17+
channel: stable
18+
cache: true
19+
20+
- name: Install dependencies
21+
run: flutter pub get
22+
23+
- name: Analyze code
24+
run: flutter analyze
25+
26+
- name: Check formatting
27+
run: dart format --set-exit-if-changed .
28+
29+
- name: Run tests
30+
run: flutter test
31+
932
publish:
33+
needs: validate
1034
permissions:
1135
id-token: write # Required for authentication using OIDC
1236
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

0 commit comments

Comments
 (0)