-
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.32 KB
/
publish_package.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
name: Publish package
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
# Publish package to pub.dev
publish:
name: 'Publish to pub.dev'
permissions:
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
steps:
# Checkout repository
- uses: actions/checkout@v3
# Setup Dart SDK with JWT token
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
# Update version number
- name: Update version number
uses: jacobtomlinson/[email protected]
with:
find: "VERSIONADDEDBYGITHUB"
replace: "${{ github.event.inputs.version || github.ref_name }}"
regex: false
# Minimal package setup
- name: Install dependencies
run: dart pub get # Don't use `make pull_deps`, will override version number
working-directory: ${{ inputs.working-directory }}
# Dry run checks
- name: Publish - dry run
run: dart pub publish --dry-run # Don't use `make test_publish`, will override version number
working-directory: ${{ inputs.working-directory }}
# Publish
- name: Publish to pub.dev
run: dart pub publish -f # Don't use `make publish`, will override version number
working-directory: ${{ inputs.working-directory }}