Skip to content

Commit be565d2

Browse files
committed
Publish using melos scope
1 parent 9bf6e93 commit be565d2

File tree

6 files changed

+51
-89
lines changed

6 files changed

+51
-89
lines changed

.github/actions/setup-melos/action.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 21 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -9,78 +9,40 @@ on:
99

1010
jobs:
1111
publish-packages:
12-
name: Publish powersync
12+
name: Publish packages
1313
permissions:
1414
contents: write
1515
id-token: write # Required for authentication using OIDC
1616
runs-on: [ubuntu-latest]
17-
if: contains(github.ref_name, 'powersync-v')
1817
steps:
1918
- uses: actions/checkout@v4
2019

2120
- uses: dart-lang/setup-dart@v1 # Creates and configures token for publishing
2221

23-
- name: Setup melos
24-
uses: ./.github/actions/setup-melos
22+
- name: Install Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
flutter-version: "3.x"
26+
channel: "stable"
2527

26-
- name: Dry run
27-
run: dart pub publish --dry-run
28-
working-directory: packages/powersync
28+
- name: Install melos
29+
run: flutter pub global activate melos
2930

30-
- name: Publish powersync
31-
run: |
32-
dart pub publish --force
33-
working-directory: packages/powersync
34-
35-
publish-powersync_attachments_helper:
36-
name: Publish powersync_attachments_helper
37-
permissions:
38-
contents: write
39-
id-token: write # Required for authentication using OIDC
40-
runs-on: [ubuntu-latest]
41-
if: contains(github.ref_name, 'powersync_attachments_helper-v')
42-
steps:
43-
- uses: actions/checkout@v4
44-
45-
- uses: dart-lang/setup-dart@v1 # Creates and configures token for publishing
46-
47-
- name: Setup melos
48-
uses: ./.github/actions/setup-melos
49-
50-
- name: Dry run
51-
run: dart pub publish --dry-run
52-
working-directory: packages/powersync_attachments_helper
31+
- name: Install dependencies
32+
run: melos bootstrap
5333

54-
- name: Publish powersync_attachments_helper
34+
- name: Get package name from tag
35+
env:
36+
GITHUBREF: ${{ github.ref }}
5537
run: |
56-
dart pub publish --force
57-
working-directory: packages/powersync_attachments_helper
38+
PACKAGE_NAME=$(sed -E 's/refs\/tags\/([a-z0-9_]+)-v([0-9]+\.[0-9]+\.[0-9]+)/\1/' <<< $GITHUBREF) && \
39+
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
40+
echo "Package name: $PACKAGE_NAME"
5841
59-
publish-powersync_flutter_libs:
60-
name: Publish powersync_flutter_libs
61-
permissions:
62-
contents: write
63-
id-token: write # Required for authentication using OIDC
64-
runs-on: [ubuntu-latest]
65-
if: contains(github.ref_name, 'powersync_flutter_libs-v')
66-
steps:
67-
- uses: actions/checkout@v4
68-
69-
- uses: dart-lang/setup-dart@v1 # Creates and configures token for publishing
70-
71-
- name: Setup melos
72-
uses: ./.github/actions/setup-melos
73-
74-
- name: Set powersync core version
75-
run: echo "CORE_VERSION=v0.1.8" >> $GITHUB_ENV
76-
- name: Download binaries
77-
run: sh tool/download_binaries.sh
78-
79-
- name: Dry run
80-
run: dart pub publish --dry-run
81-
working-directory: packages/powersync_flutter_libs
42+
- name: Publish packages dry run
43+
run: |
44+
melos publish --yes --scope=$PACKAGE_NAME
8245
83-
- name: Publish powersync_flutter_libs
46+
- name: Publish packages
8447
run: |
85-
dart pub publish --force
86-
working-directory: packages/powersync_flutter_libs
48+
melos publish --no-dry-run --yes --scope=$PACKAGE_NAME

melos.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ command:
1515
packageFilters:
1616
noPrivate: true
1717
publish:
18+
hooks:
19+
pre: sh tool/download_binaries.sh v0.1.8 # Download latest core binaries when publishing
1820
packageFilters:
1921
noPrivate: true
2022

pubspec.lock

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ packages:
7373
url: "https://pub.dev"
7474
source: hosted
7575
version: "0.4.1"
76+
clock:
77+
dependency: transitive
78+
description:
79+
name: clock
80+
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
81+
url: "https://pub.dev"
82+
source: hosted
83+
version: "1.1.1"
7684
collection:
7785
dependency: transitive
7886
description:
@@ -117,10 +125,10 @@ packages:
117125
dependency: transitive
118126
description:
119127
name: file
120-
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
128+
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
121129
url: "https://pub.dev"
122130
source: hosted
123-
version: "6.1.4"
131+
version: "7.0.0"
124132
frontend_server_client:
125133
dependency: transitive
126134
description:
@@ -169,6 +177,14 @@ packages:
169177
url: "https://pub.dev"
170178
source: hosted
171179
version: "4.0.2"
180+
intl:
181+
dependency: transitive
182+
description:
183+
name: intl
184+
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
185+
url: "https://pub.dev"
186+
source: hosted
187+
version: "0.19.0"
172188
io:
173189
dependency: transitive
174190
description:
@@ -221,10 +237,10 @@ packages:
221237
dependency: "direct dev"
222238
description:
223239
name: melos
224-
sha256: "96e64bbade5712c3f010137e195bca9f1b351fac34ab1f322af492ae34032067"
240+
sha256: a3f06ed871e0348cb99909ad5ddf5f8b53cc61d894c302b5417d2db1ee7ec381
225241
url: "https://pub.dev"
226242
source: hosted
227-
version: "3.4.0"
243+
version: "6.1.0"
228244
meta:
229245
dependency: transitive
230246
description:
@@ -293,10 +309,10 @@ packages:
293309
dependency: transitive
294310
description:
295311
name: process
296-
sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
312+
sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32"
297313
url: "https://pub.dev"
298314
source: hosted
299-
version: "4.2.4"
315+
version: "5.0.2"
300316
prompts:
301317
dependency: transitive
302318
description:
@@ -317,10 +333,10 @@ packages:
317333
dependency: transitive
318334
description:
319335
name: pub_updater
320-
sha256: b06600619c8c219065a548f8f7c192b3e080beff95488ed692780f48f69c0625
336+
sha256: "54e8dc865349059ebe7f163d6acce7c89eb958b8047e6d6e80ce93b13d7c9e60"
321337
url: "https://pub.dev"
322338
source: hosted
323-
version: "0.3.1"
339+
version: "0.4.0"
324340
pubspec:
325341
dependency: transitive
326342
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ environment:
99

1010
dev_dependencies:
1111
lints: ^2.1.1
12-
melos: ^3.4.0
12+
melos: ^6.1.0
1313
test: ^1.25.0
1414
path: ^1.0.0

tool/download_binaries.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
if [ -z "$CORE_VERSION" ]; then
4-
echo "CORE_VERSION is not set";
3+
if [ -z "$1" ]; then
4+
echo "Core version is not set";
55
exit 2;
66
fi
77

8-
github="https://github.com/powersync-ja/powersync-sqlite-core/releases/download/$CORE_VERSION"
8+
github="https://github.com/powersync-ja/powersync-sqlite-core/releases/download/$1"
99

1010
curl "${github}/libpowersync_aarch64.so" -o packages/powersync_flutter_libs/linux/libpowersync_aarch64.so --create-dirs -L -f
1111
curl "${github}/libpowersync_x64.so" -o packages/powersync_flutter_libs/linux/libpowersync_x64.so --create-dirs -L -f

0 commit comments

Comments
 (0)