From 9ed4a03146c2690a3f606c983d4522de2a01424a Mon Sep 17 00:00:00 2001 From: Mugi Khan Date: Fri, 12 Jul 2024 12:07:47 +0200 Subject: [PATCH 1/2] Build macOS binaries for testing in powersync --- .github/workflows/release.yml | 21 +++++++++++++++++++++ tool/build_macos.sh | 10 ++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tool/build_macos.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ca47f7..5f12657 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -158,3 +158,24 @@ jobs: file: powersync_x64.dll asset_name: powersync_x64.dll tag: ${{ needs.draft_release.outputs.tag }} + + publish_macOS: + name: Publish macOS + needs: [draft_release] + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Build binary + run: bash tool/build_macos.sh aarch64 + + - name: Upload binary x64 + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + overwrite: true + file: powersync_x64.dll + asset_name: powersync_x64.dll + tag: ${{ needs.draft_release.outputs.tag }} diff --git a/tool/build_macos.sh b/tool/build_macos.sh new file mode 100644 index 0000000..18428bc --- /dev/null +++ b/tool/build_macos.sh @@ -0,0 +1,10 @@ +if [ "$1" = "x64" ]; then + #Note: x86_64-apple-darwin has not been tested. + rustup target add target x86_64-apple-darwin + cargo build -p powersync_loadable --release + mv "target/release/libpowersync.dylib" "libpowersync_x64.dylib" +else + rustup target add aarch64-apple-darwin + cargo build -p powersync_loadable --release + mv "target/release/libpowersync.dylib" "libpowersync_aarch64.dylib" +fi From 6d6e10977455af44988d7a70febb822e82c98f07 Mon Sep 17 00:00:00 2001 From: Mugi Khan Date: Fri, 12 Jul 2024 12:09:48 +0200 Subject: [PATCH 2/2] Fix file names --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f12657..7fcb676 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -162,7 +162,7 @@ jobs: publish_macOS: name: Publish macOS needs: [draft_release] - runs-on: windows-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 with: @@ -171,11 +171,11 @@ jobs: - name: Build binary run: bash tool/build_macos.sh aarch64 - - name: Upload binary x64 + - name: Upload binary aarch64 uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} overwrite: true - file: powersync_x64.dll - asset_name: powersync_x64.dll + file: libpowersync_aarch64.dylib + asset_name: libpowersync_aarch64.dylib tag: ${{ needs.draft_release.outputs.tag }}