-
Notifications
You must be signed in to change notification settings - Fork 17
44 lines (38 loc) · 1.02 KB
/
publish.yml
File metadata and controls
44 lines (38 loc) · 1.02 KB
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: Analyze, test and publish
on:
push:
tags:
- "*"
env:
FLUTTER_VERSION: '3.x'
jobs:
# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57
analyze:
runs-on: ubuntu-latest
name: Dart Analyze
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter analyze
publish:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
- name: Get pub.dev token
uses: actions/github-script@v6
with:
script: |
let pub_token = await core.getIDToken('https://pub.dev')
core.exportVariable('PUB_TOKEN', pub_token)
- name: Publish
run: |
flutter pub pub token add https://pub.dev --env-var PUB_TOKEN
flutter pub publish --force