Fix multi-platform packaging (#14)

* Fix multi-platform packaging

* Add arm64 windows and linux targets

* Speedup windows msvc linking

* Improve cargo cache

* fix arm64 linux build
This commit is contained in:
Solomon
2025-06-30 12:25:57 +01:00
committed by GitHub
parent 5c452e78e2
commit 0988f0b146
5 changed files with 59 additions and 15 deletions

View File

@@ -7,3 +7,9 @@ MACOSX_DEPLOYMENT_TARGET = "10.12"
[target.aarch64-apple-darwin.env]
MACOSX_DEPLOYMENT_TARGET = "11.0"
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=/DEBUG:FASTLINK"]
[target.aarch64-pc-windows-msvc]
rustflags = ["-C", "link-arg=/DEBUG:FASTLINK"]

View File

@@ -109,15 +109,15 @@ jobs:
- target: aarch64-apple-darwin
os: macos-14
name: macos-arm64
- target: aarch64-pc-windows-msvc
os: windows-latest-l
name: windows-arm64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: linux-arm64
steps:
- uses: actions/checkout@v4
- name: Download frontend artifact
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: frontend/dist/
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
@@ -127,11 +127,18 @@ jobs:
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
env:
RUST_CACHE_DEBUG: true
with:
workspaces: "backend"
key: ${{ matrix.target }}-${{ matrix.os }}
workspaces: "."
key: ${{ matrix.target }}
cache-on-failure: true
shared-key: "shared"
cache-all-crates: true
- name: Download frontend artifact
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: frontend/dist/
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
@@ -139,8 +146,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev
- name: Install ARM64 cross-compilation dependencies (Linux)
if: matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross
- name: Build backend for target
run: cargo build --release --target ${{ matrix.target }} --manifest-path backend/Cargo.toml
run: cargo build --release --target ${{ matrix.target }} -p vibe-kanban
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: ${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'aarch64-linux-gnu-gcc' || '' }}
- name: Prepare binary
shell: bash
@@ -179,6 +193,12 @@ jobs:
- target: aarch64-apple-darwin
name: macos-arm64
binary: vibe-kanban
- target: aarch64-pc-windows-msvc
name: windows-arm64
binary: vibe-kanban.exe
- target: aarch64-unknown-linux-gnu
name: linux-arm64
binary: vibe-kanban
steps:
- uses: actions/checkout@v4
@@ -194,6 +214,11 @@ jobs:
name: backend-binary-${{ matrix.name }}
path: dist/
- name: List downloaded artifacts
run: |
echo "Downloaded backend binary:"
find dist/
- name: Create platform package
run: |
mkdir -p npx-cli/dist/${{ matrix.name }}
@@ -206,7 +231,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: npx-platform-${{ matrix.name }}
path: npx-cli/dist/${{ matrix.name }}/
path: npx-cli/dist/
retention-days: 1
create-prerelease:
@@ -232,6 +257,13 @@ jobs:
path: npx-cli/dist/
merge-multiple: true
- name: List downloaded artifacts
run: |
echo "Backend dist:"
find npx-cli/dist
echo "Frontend dist:"
find frontend/dist
- name: Zip frontend
run: |
mkdir vibe-kanban-${{ github.ref_name }}

View File

@@ -12,8 +12,12 @@ const arch = process.arch;
function getPlatformDir() {
if (platform === "linux" && arch === "x64") {
return "linux-x64";
} else if (platform === "linux" && arch === "arm64") {
return "linux-arm64";
} else if (platform === "win32" && arch === "x64") {
return "windows-x64";
} else if (platform === "win32" && arch === "arm64") {
return "windows-arm64";
} else if (platform === "darwin" && arch === "x64") {
return "macos-x64";
} else if (platform === "darwin" && arch === "arm64") {
@@ -22,7 +26,9 @@ function getPlatformDir() {
console.error(`❌ Unsupported platform: ${platform}-${arch}`);
console.error("Supported platforms:");
console.error(" - Linux x64");
console.error(" - Linux ARM64");
console.error(" - Windows x64");
console.error(" - Windows ARM64");
console.error(" - macOS x64 (Intel)");
console.error(" - macOS ARM64 (Apple Silicon)");
process.exit(1);

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "vibe-kanban",
"version": "0.0.1",
"version": "0.0.24",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "vibe-kanban",
"version": "0.0.1",
"version": "0.0.24",
"devDependencies": {
"concurrently": "^8.2.2",
"vite": "^6.3.5"

View File

@@ -1,6 +1,6 @@
{
"name": "vibe-kanban",
"version": "0.0.1",
"version": "0.0.24",
"private": true,
"scripts": {
"dev": "concurrently \"cargo watch -w backend -x 'run --manifest-path backend/Cargo.toml'\" \"npm run frontend:dev\"",