Skip to content

Trigger publish on new packages #66

Trigger publish on new packages

Trigger publish on new packages #66

Workflow file for this run

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]+*"
- "powersync_core-v[0-9]+.[0-9]+.[0-9]+*"
- "powersync_sqlcipher-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]+(\+[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