Skip to content

Fix publishing automation (#400) #164

Fix publishing automation (#400)

Fix publishing automation (#400) #164

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]+*"
workflow_dispatch:
jobs:
setup:
uses: ./.github/workflows/prepare_wasm.yml
github_release:
runs-on: ubuntu-latest
if: "${{ startsWith(github.ref_name, 'powersync-') }}"
needs: [setup]
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- uses: ./.github/actions/prepare
- name: Create Draft Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
tag="${{ github.ref_name }}"
version="${tag#powersync-v}"
changes=$(awk "/## $version/{flag=1;next}/##/{flag=0}flag" packages/powersync/CHANGELOG.md)
body="Release $tag
$changes"
gh release create "$tag" --title "$tag" --notes "$body"
gh release upload "${{ github.ref_name }}" packages/powersync/assets/powersync_db.worker.js packages/sqlite3_wasm_build/dist/*.wasm
publish_powersync:
permissions:
id-token: write
if: "${{ startsWith(github.ref_name, 'powersync-') }}"
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: packages/powersync
publish_powersync_flutter_libs:
permissions:
id-token: write
if: "${{ startsWith(github.ref_name, 'powersync_flutter_libs-') }}"
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: packages/powersync_flutter_libs
publish_powersync_attachments_helper:
permissions:
id-token: write
if: "${{ startsWith(github.ref_name, 'powersync_attachments_helper-') }}"
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: packages/powersync_attachments_helper