-
Notifications
You must be signed in to change notification settings - Fork 377
109 lines (100 loc) · 3.16 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Publish to pub.dev
on:
push:
tags:
- 'drift-[0-9]+.[0-9]+.[0-9]+*'
- 'drift_dev-[0-9]+.[0-9]+.[0-9]+*'
- 'sqlparser-[0-9]+.[0-9]+.[0-9]+*'
- 'drift_postgres-[0-9]+.[0-9]+.[0-9]+*'
jobs:
setup:
uses: ./.github/workflows/setup.yml
publish_drift:
if: "${{ startsWith(github.ref_name, 'drift-') }}"
needs: [setup]
runs-on: ubuntu-latest
environment: pub.dev
permissions:
id-token: write # Required for authentication using OIDC
steps:
- uses: actions/checkout@v4
# We need to build the DevTools extension, which is written in Flutter
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- uses: actions/cache@v3
with:
path: "${{ env.PUB_CACHE }}"
key: dart-dependencies-${{ needs.setup.outputs.dart_version }}-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
dart-dependencies-${{ needs.setup.outputs.dart_version }}-
dart-dependencies-
- name: Setup dependencies
run: |
dart pub global activate melos
dart pub get
melos bootstrap
shell: bash
- name: Build DevTools extension
working-directory: extras/drift_devtools_extension
run: ./build.sh
- run: dart pub lish --dry-run
working-directory: drift
- run: dart pub lish -f
working-directory: drift
publish_drift_dev:
if: "${{ startsWith(github.ref_name, 'drift_dev-') }}"
needs: [setup]
runs-on: ubuntu-latest
environment: pub.dev
permissions:
id-token: write # Required for authentication using OIDC
defaults:
run:
working-directory: drift_dev
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
with:
dart_version: ${{ needs.setup.outputs.dart_version }}
- run: melos bootstrap --scope drift_dev
working-directory: .
- run: dart pub lish --dry-run
- run: dart pub lish -f
# Published versions of sqlparser are tagged with `sqlparser-<version>`
publish_sqlparser:
if: "${{ startsWith(github.ref_name, 'sqlparser-') }}"
needs: [setup]
runs-on: ubuntu-latest
environment: pub.dev
permissions:
id-token: write # Required for authentication using OIDC
defaults:
run:
working-directory: sqlparser
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
with:
dart_version: ${{ needs.setup.outputs.dart_version }}
- run: dart pub get
- run: dart pub lish --dry-run
- run: dart pub lish -f
publish_drift_postgres:
if: "${{ startsWith(github.ref_name, 'drift_postgres-') }}"
needs: [setup]
runs-on: ubuntu-latest
environment: pub.dev
permissions:
id-token: write # Required for authentication using OIDC
defaults:
run:
working-directory: extras/drift_postgres
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
with:
dart_version: ${{ needs.setup.outputs.dart_version }}
- run: dart pub get
- run: dart pub lish --dry-run
- run: dart pub lish -f