Skip to content

Commit c9ef6bf

Browse files
authored
ci: automate publishing to pub.dev (#719)
1 parent 090f7f4 commit c9ef6bf

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release-manual.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: release-manual
2+
on:
3+
release:
4+
types:
5+
- published
6+
jobs:
7+
dry-run:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
- name: Dry run dart package
13+
uses: k-paxian/[email protected]
14+
id: try-dart
15+
with:
16+
accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }}
17+
refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }}
18+
relativePath: packages/dart
19+
format: true
20+
dryRunOnly: true
21+
- name: Dry run flutter package
22+
uses: k-paxian/[email protected]
23+
id: try-flutter
24+
with:
25+
accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }}
26+
refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }}
27+
flutter: true
28+
relativePath: packages/flutter
29+
format: true
30+
dryRunOnly: true
31+
- name: Check outputs
32+
run: ${{steps.try-dart.outputs.success}} && ${{steps.try-flutter.outputs.success}}
33+
release:
34+
runs-on: ubuntu-latest
35+
needs: dry-run
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
- name: Publish dart package
40+
uses: k-paxian/[email protected]
41+
with:
42+
accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }}
43+
refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }}
44+
relativePath: packages/dart
45+
format: true
46+
- name: Publish flutter package
47+
uses: k-paxian/[email protected]
48+
with:
49+
accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }}
50+
refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }}
51+
flutter: true
52+
relativePath: packages/flutter
53+
format: true

0 commit comments

Comments
 (0)