Skip to content

Fix release CI

Fix release CI #248

Workflow file for this run

name: release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
draft_release:
name: Create Draft GitHub Release
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set tag name
id: tag
run: |
tag=$(basename "${{ github.ref }}")
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
tag="${{ steps.tag.outputs.tag }}"
body="Release $tag"
gh release create --draft "$tag" --title "$tag" --notes "$body"
build_android:
name: Build Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build Android
uses: ./.github/actions/android
with:
gpg-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-password: ${{ secrets.GPG_PASSWORD }}
publish_android:
permissions:
contents: read
packages: write
name: Publish Android
needs: [ draft_release, build_android ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: android-library
- name: Publish to Maven Central
run: |
curl --request POST \
--header 'Authorization: Bearer ${{ secrets.CENTRAL_AUTH }}' \
--form bundle=@powersync_android.zip \
'https://central.sonatype.com/api/v1/publisher/upload?publishingType=AUTOMATIC'
- name: Upload binary
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: powersync_android.zip
tag: ${{ needs.draft_release.outputs.tag }}
publish_ios_pod_and_spm_package:
name: Publish iOS
needs: [ draft_release ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup
run: |
rustup toolchain install nightly-2025-04-15-aarch64-apple-darwin
rustup component add rust-src --toolchain nightly-2025-04-15-aarch64-apple-darwin
rustup target add \
x86_64-apple-darwin \
aarch64-apple-darwin \
aarch64-apple-ios \
aarch64-apple-ios-sim \
x86_64-apple-ios
- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.16.2
- name: Build iOS & macOS xcframework
run: |
./tool/build_xcframework.sh
- name: Lint pod
run: |
pod lib lint
# For SPM package
- name: Set xcFramework file name used for SPM package
id: fileName
run: |
FILENAME=powersync-sqlite-core.xcframework.zip
echo "fileName=$FILENAME" >> $GITHUB_OUTPUT
- name: Upload xcframework
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release upload "${{ needs.draft_release.outputs.tag }}" ${{ steps.fileName.outputs.fileName }}
# For SPM package
- name: Generate and add checksum to output
id: checksum
run: |
CHECKSUM=$(swift package compute-checksum ${{ steps.fileName.outputs.fileName }})
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
- name: Dispatch release to SPM package
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SWIFT_PUBLISH_TOKEN }}
repository: powersync-ja/powersync-sqlite-core-swift
event-type: spm-release
client-payload: |-
{
"repository": "${{ github.repository }}",
"title": "${{ needs.draft_release.outputs.tag }}",
"tag": "${{ needs.draft_release.outputs.tag }}",
"checksum": "${{ steps.checksum.outputs.checksum }}",
"fileName": "${{ steps.fileName.outputs.fileName }}"
}
publish_linux_x86_64:
name: Publish Linux x86_64
needs: [ draft_release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
- name: Build binaries
run: ./tool/build_linux.sh x64
- name: Upload binary
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync_x64.so
tag: ${{ needs.draft_release.outputs.tag }}
publish_linux_aarch64:
name: Publish Linux aarch64
needs: [ draft_release ]
runs-on: ubuntu-arm64
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
- name: Build binaries
run: ./tool/build_linux.sh aarch64
- name: Upload binary
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync_aarch64.so
tag: ${{ needs.draft_release.outputs.tag }}
publish_windows_x64:
name: Publish Windows x64
needs: [ draft_release ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
- name: Build binary
run: bash tool/build_windows.sh x64
- name: Upload binary
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: powersync_x64.dll
tag: ${{ needs.draft_release.outputs.tag }}
publish_macOS_aarch64:
name: Publish macOS aarch64
needs: [ draft_release ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
- name: Build binary
run: ./tool/build_macos.sh aarch64
- name: Upload binary
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync_aarch64.dylib
tag: ${{ needs.draft_release.outputs.tag }}
publish_macOS_x64:
name: Publish macOS x64
needs: [ draft_release ]
runs-on: macos-14
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
- name: Build binary
run: ./tool/build_macos.sh x64
- name: Upload binary
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync_x64.dylib
tag: ${{ needs.draft_release.outputs.tag }}
publish_wasm:
name: Publish WASM builds
needs: [ draft_release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-15
components: rust-src
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.10
- name: Build WASM
run: ./tool/build_wasm.sh
- name: Upload libpowersync.wasm
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync.wasm
tag: ${{ needs.draft_release.outputs.tag }}
- name: Upload libpowersync-async.wasm
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync-async.wasm
tag: ${{ needs.draft_release.outputs.tag }}
- name: Upload libpowersync-wasm.a
uses: ./.github/actions/upload
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
file-name: libpowersync-wasm.a
tag: ${{ needs.draft_release.outputs.tag }}
create_sdk_issue:
name: "Create issue for SDK updates"
permissions:
issues: write
runs-on: macos-latest
needs:
- draft_release
- publish_android
- publish_ios_pod_and_spm_package
- publish_linux_x86_64
- publish_linux_aarch64
- publish_windows_x64
- publish_macOS_aarch64
- publish_macOS_x64
- publish_wasm
steps:
- name: Create issue
run: |
gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--body "$BODY"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: "Release checklist: ${{ needs.draft_release.outputs.tag }}"
ASSIGNES: ${{ github.event.push.sender }}
BODY: |
This is a checklist to track the release of ${{ needs.draft_release.outputs.tag }}.
Core build (this repo):
* [x] GitHub Release
* [ ] Android aar released on Maven Central
* [ ] Cocoapod released
SQLite + powersync bundles:
* [ ] react-native-quick-sqlite:
* [ ] wa-sqlite build:
* [ ] sql.js dev adapter:
User-facing SDK updates:
* [ ] powersync.dart:
* [ ] powersync-js:
* [ ] kotlin:
* [ ] swift: