-
Notifications
You must be signed in to change notification settings - Fork 23
48 lines (40 loc) · 1.34 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
name: Publish packages
on:
push:
tags:
- "powersync-v[0-9]+.[0-9]+.[0-9]+"
- "powersync_attachments_helper-v[0-9]+.[0-9]+.[0-9]+*"
- "powersync_flutter_libs-v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
jobs:
publish-packages:
name: Publish packages
permissions:
contents: write
id-token: write # Required for authentication using OIDC
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1 # Creates and configures token for publishing
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: "stable"
- name: Install melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
- name: Get package name from tag
env:
GITHUBREF: ${{ github.ref }}
run: |
PACKAGE_NAME=$(sed -E 's/refs\/tags\/([a-z0-9_]+)-v([0-9]+\.[0-9]+\.[0-9]+)/\1/' <<< $GITHUBREF) && \
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "Package name: $PACKAGE_NAME"
- name: Publish packages dry run
run: |
melos publish --yes --scope=$PACKAGE_NAME
- name: Publish packages
run: |
melos publish --no-dry-run --yes --scope=$PACKAGE_NAME