-
-
Notifications
You must be signed in to change notification settings - Fork 19
45 lines (43 loc) · 1.15 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# https://dart.dev/tools/pub/automated-publishing#hardening-security-with-tag-protection-rules-on-github
name: Publish to pub.dev
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # tag pattern on pub.dev: 'v{{version}'
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Analyze
run: dart analyze
- name: Format
run: dart format --set-exit-if-changed .
- name: Dry run
run: flutter pub publish --dry-run
test:
needs: analyze
uses: ./.github/workflows/ci.yml
with:
run_all: true
publish:
environment: pub.dev
needs: test
permissions:
id-token: write # Required for authentication using OIDC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- uses: dart-lang/setup-dart@v1
- name: Publish
run: dart pub publish --force