Skip to content

Commit 1645ae3

Browse files
authored
Add release validation workflow for GitHub Actions
1 parent ebacb27 commit 1645ae3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release Validation
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Flutter (latest stable)
16+
uses: subosito/flutter-action@v2
17+
with:
18+
channel: stable
19+
20+
- name: Install dependencies
21+
run: flutter pub get
22+
23+
- name: Validate version matches tag
24+
run: |
25+
TAG=${GITHUB_REF#refs/tags/}
26+
PUB_VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
27+
if [ "$TAG" != "$PUB_VERSION" ]; then
28+
echo "Tag ($TAG) does not match pubspec version ($PUB_VERSION)"
29+
exit 1
30+
fi
31+
32+
- name: Ensure CHANGELOG updated
33+
run: |
34+
grep -q "$TAG" CHANGELOG.md || (echo "CHANGELOG missing version $TAG" && exit 1)
35+
36+
- name: Dry-run pub publish
37+
run: dart pub publish --dry-run

0 commit comments

Comments
 (0)