Skip to content

Commit 567a1a7

Browse files
authored
Enable linux arm64 builds (#13)
* Enable linux arm64 builds * Add composite action for uploading * Fix windows file name
1 parent 525f6d9 commit 567a1a7

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

.github/workflows/actions/upload.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Upload binary file"
2+
description: "Upload binary file to GitHub releases"
3+
inputs:
4+
repo-token:
5+
required: true
6+
description: "The secret created for the workflow run"
7+
file-name:
8+
required: true
9+
description: "The file name to be uploaded"
10+
tag:
11+
required: false
12+
description: "The short ref name of the branch or tag that triggered the workflow run."
13+
default: ${{ github.ref_name }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Upload binary
18+
uses: svenstaro/upload-release-action@v2
19+
with:
20+
repo_token: ${{ inputs.repo-token }}
21+
overwrite: true
22+
file: ${{ inputs.file-name }}
23+
asset_name: ${{ inputs.file-name }}
24+
tag: ${{ inputs.tag }}

.github/workflows/linux.yml

+34
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
push:
33
tags:
44
- "*"
5+
workflow_dispatch:
56
name: "linux"
67
jobs:
78
build_x86_64:
@@ -20,3 +21,36 @@ jobs:
2021

2122
- name: Build binaries
2223
run: bash tool/build_linux.sh x64
24+
25+
- name: Upload binary
26+
if: github.event_name == 'workflow_dispatch'
27+
uses: ./.github/actions/upload
28+
with:
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
file-name: libpowersync_x64.so
31+
tag: ${{ github.ref_name }}
32+
33+
build_aarch64:
34+
name: Building Linux aarch64
35+
runs-on: ubuntu-arm64
36+
steps:
37+
- uses: actions/checkout@v3
38+
with:
39+
submodules: true
40+
41+
- name: Install Rust Nightly
42+
uses: dtolnay/rust-toolchain@stable
43+
with:
44+
toolchain: nightly-2024-05-18
45+
components: rust-src
46+
47+
- name: Build binaries
48+
run: bash tool/build_linux.sh aarch64
49+
50+
- name: Upload binary
51+
if: github.event_name == 'workflow_dispatch'
52+
uses: ./.github/actions/upload
53+
with:
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
file-name: libpowersync_aarch64.so
56+
tag: ${{ github.ref_name }}

.github/workflows/windows.yml

+8
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ jobs:
1414

1515
- name: Build binary
1616
run: bash tool/build_windows.sh x64
17+
18+
- name: Upload binary
19+
if: github.event_name == 'workflow_dispatch'
20+
uses: ./.github/actions/upload
21+
with:
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
file-name: powersync_x64.dll
24+
tag: ${{ github.ref_name }}

tool/build_linux.sh

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ if [ "$1" = "x64" ]; then
33
cargo build -p powersync_loadable --release
44
mv "target/release/libpowersync.so" "libpowersync_x64.so"
55
else
6-
#Note: aarch64-unknown-linux-gnu has not been tested.
76
rustup target add aarch64-unknown-linux-gnu
87
cargo build -p powersync_loadable --release
98
mv "target/release/libpowersync.so" "libpowersync_aarch64.so"

0 commit comments

Comments
 (0)