-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (39 loc) · 1.25 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
46
47
name: Publish to pub.dev
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
publish:
permissions:
contents: write # required to create release
id-token: write # Required for authentication using OIDC
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
# This action adds a token needed for pub.dev
- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
flutter-version: ${{ matrix.version }}
- name: Set version data
run: |
tag=${{ github.ref_name }}
echo "RELEASE_NOTES=$(link_changelog $tag)" >> $GITHUB_ENV
echo "IS_PRERELEASE=$(is_prerelease $tag)" >> $GITHUB_ENV
- name: Publish to pub.dev
run: flutter pub publish --force
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
body: '[See changelog on pub.dev](${{ env.RELEASE_NOTES }})'
prerelease: ${{ env.IS_PRERELEASE }}
files: |
CHANGELOG.md