Skip to content

Commit 9991186

Browse files
yadaniyilclaude
andcommitted
ci: add GitHub Actions for CI and pub.dev publishing
- ci.yml: runs on every PR and push to master (analyze, format check, tests) - publish.yml: publishes to pub.dev on v* tag push using OIDC (no stored secrets) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2c92a8c commit 9991186

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
test:
10+
name: Test & Analyze
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: subosito/flutter-action@v2
16+
with:
17+
channel: stable
18+
19+
- name: Install dependencies
20+
run: flutter pub get
21+
22+
- name: Analyze
23+
run: flutter analyze lib/ test/ example/
24+
25+
- name: Format check
26+
run: dart format --set-exit-if-changed .
27+
28+
- name: Test
29+
run: flutter test --coverage --test-randomize-ordering-seed random

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
name: Publish
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write # required for OIDC pub.dev publishing
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: subosito/flutter-action@v2
19+
with:
20+
channel: stable
21+
22+
- name: Install dependencies
23+
run: flutter pub get
24+
25+
- name: Analyze
26+
run: flutter analyze lib/ test/
27+
28+
- name: Test
29+
run: flutter test --test-randomize-ordering-seed random
30+
31+
- name: Publish
32+
run: flutter pub publish --force

0 commit comments

Comments
 (0)