release #235
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
publish: | |
type: boolean | |
required: false | |
default: false | |
description: Set to true to publish artifacts to external targets such as Maven Central | |
jobs: | |
draft_release: | |
if: github.event_name == 'workflow_dispatch' | |
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" | |
publish_android: | |
permissions: | |
contents: read | |
packages: write | |
name: Publish Android | |
needs: [draft_release] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Setup | |
run: | | |
rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu | |
rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu | |
rustup target add \ | |
aarch64-linux-android \ | |
armv7-linux-androideabi \ | |
x86_64-linux-android \ | |
i686-linux-android | |
cargo install cargo-ndk | |
- name: Publish for Android | |
if: ${{ inputs.publish }} | |
run: | | |
cd android | |
./gradlew publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
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-2024-05-18-aarch64-apple-darwin | |
rustup component add rust-src --toolchain nightly-2024-05-18-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.12.1 | |
- 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-2024-05-18 | |
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-2024-05-18 | |
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-2024-05-18 | |
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-2024-05-18 | |
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-2024-05-18 | |
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@v3 | |
with: | |
submodules: true | |
- name: Install Rust Nightly | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly-2024-05-18 | |
components: rust-src | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v14 | |
with: | |
version: 3.1.68 | |
- 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 }} |