Skip to content

Publish packages based on tags #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
- "powersync_flutter_libs-v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
publish-packages:
name: Publish packages
Expand All @@ -35,13 +31,18 @@ jobs:
- name: Install dependencies
run: melos bootstrap

- name: Set powersync core version
run: echo "CORE_VERSION=v0.1.8" >> $GITHUB_ENV
- 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
melos publish --yes --scope=$PACKAGE_NAME

- name: Publish packages
run: |
melos publish --no-dry-run --yes
melos publish --no-dry-run --yes --scope=$PACKAGE_NAME
2 changes: 1 addition & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ command:
noPrivate: true
publish:
hooks:
pre: sh tool/download_binaries.sh
pre: sh tool/download_binaries.sh v0.1.8 # Download latest core binaries when publishing
packageFilters:
noPrivate: true

Expand Down
32 changes: 24 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.1"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -117,10 +125,10 @@ packages:
dependency: transitive
description:
name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev"
source: hosted
version: "6.1.4"
version: "7.0.0"
frontend_server_client:
dependency: transitive
description:
Expand Down Expand Up @@ -169,6 +177,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
dependency: transitive
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.19.0"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -221,10 +237,10 @@ packages:
dependency: "direct dev"
description:
name: melos
sha256: "96e64bbade5712c3f010137e195bca9f1b351fac34ab1f322af492ae34032067"
sha256: a3f06ed871e0348cb99909ad5ddf5f8b53cc61d894c302b5417d2db1ee7ec381
url: "https://pub.dev"
source: hosted
version: "3.4.0"
version: "6.1.0"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -293,10 +309,10 @@ packages:
dependency: transitive
description:
name: process
sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32"
url: "https://pub.dev"
source: hosted
version: "4.2.4"
version: "5.0.2"
prompts:
dependency: transitive
description:
Expand All @@ -317,10 +333,10 @@ packages:
dependency: transitive
description:
name: pub_updater
sha256: b06600619c8c219065a548f8f7c192b3e080beff95488ed692780f48f69c0625
sha256: "54e8dc865349059ebe7f163d6acce7c89eb958b8047e6d6e80ce93b13d7c9e60"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
version: "0.4.0"
pubspec:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ environment:

dev_dependencies:
lints: ^2.1.1
melos: ^3.4.0
melos: ^6.1.0
test: ^1.25.0
path: ^1.0.0
6 changes: 3 additions & 3 deletions tool/download_binaries.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

if [ -z "$CORE_VERSION" ]; then
echo "CORE_VERSION is not set";
if [ -z "$1" ]; then
echo "Core version is not set";
exit 2;
fi

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

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