Build server for multiple arch (#106)

This commit is contained in:
Andras Schmelczer 2025-08-30 21:50:34 +01:00 committed by GitHub
parent 9177984ff6
commit 4cdd0cbd40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 111 additions and 28 deletions

View file

@ -22,6 +22,12 @@ jobs:
with:
node-version: "22.x"
check-latest: true
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.89.0"
components: clippy, rustfmt
- name: Setup rust
run: |

View file

@ -23,6 +23,12 @@ jobs:
node-version: "22.x"
check-latest: true
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.89.0"
components: clippy, rustfmt
- name: Setup rust
run: |
cargo install sqlx-cli

View file

@ -67,6 +67,7 @@ jobs:
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: sync-server
platforms: linux/amd64,linux/arm64
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View file

@ -26,15 +26,32 @@ jobs:
npm ci
npm run build
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.89.0"
components: clippy, rustfmt
- name: Install cross-compilation tools
run: |
apt update
apt install -y gcc-aarch64-linux-gnu musl-tools gcc-mingw-w64-x86-64
- name: Build Linux and Windows binaries
run: ./scripts/build-sync-server-binaries.sh
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
cd frontend/obsidian-plugin/dist
mkdir -p release
cp frontend/obsidian-plugin/dist/* release/
cp sync-server/artifacts/sync-server-* release/
cd release
gh release create "$tag" \
--title="$tag" \
--draft \
main.js manifest.json styles.css
*