Skip to content

Commit 0bf92dd

Browse files
authored
Create action.yml
1 parent d85874a commit 0bf92dd

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Flutter package to pub.dev
2+
description: Publish your Flutter package to pub.dev
3+
4+
inputs:
5+
working-directory:
6+
description: directory with-in the repository where the package is located (if not in the repository root)
7+
required: false
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: 📚 Git Checkout
13+
uses: actions/checkout@v4
14+
- name: 🐦 Setup Dart
15+
uses: dart-lang/setup-dart@v1
16+
17+
- name: 🪪 Get Id Token
18+
uses: actions/github-script@v6
19+
with:
20+
script: |
21+
let pub_token = await core.getIDToken('https://pub.dev')
22+
core.exportVariable('PUB_TOKEN', pub_token)
23+
24+
- name: 📢 Authenticate
25+
shell: ${{ inputs.shell }}
26+
run: dart pub token add https://pub.dev --env-var PUB_TOKEN
27+
28+
- name: 📦 Install dependencies
29+
shell: ${{ inputs.shell }}
30+
run: dart pub get
31+
working-directory: ${{ inputs.working-directory }}
32+
33+
# - name: 🌵 Dry Run
34+
# shell: ${{ inputs.shell }}
35+
# run: dart pub publish --dry-run
36+
# working-directory: ${{ inputs.working-directory }}
37+
38+
- name: 📢 Publish
39+
shell: ${{ inputs.shell }}
40+
run: flutter pub publish -f
41+
working-directory: ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)