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:
56
.github/workflows/pre-release.yml
vendored
56
.github/workflows/pre-release.yml
vendored
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user