Skip to content

Commit

Permalink
chore: fix arm build
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Apr 24, 2024
1 parent 23b7080 commit 63fd3dd
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 169 deletions.
81 changes: 30 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,29 +181,11 @@ jobs:

- name: Install Rust toolchain
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions-rs/toolchain@v1
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: minimal
# additionally install wasm32-unknown-unknown target
target: wasm32-unknown-unknown

- name: Cache cargo dependencies
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-deps-wasm-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}

- name: Cache cargo build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/cache@v4
with:
path: packages/qwik/src/wasm/target
key: cargo-build-wasm-${{ runner.os }}-${{ hashFiles('./packages/qwik/src/wasm/Cargo.lock') }}

- name: Install NPM Dependencies
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: |
Expand All @@ -222,6 +204,7 @@ jobs:

- name: Print WASM Dist Build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
continue-on-error: true
run: tree packages/qwik/dist/bindings/

- name: Upload WASM Build Artifacts
Expand All @@ -232,25 +215,38 @@ jobs:
path: packages/qwik/dist/bindings/*
if-no-files-found: error

- name: Build Platform Binding
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: pnpm tsm scripts/index.ts --platform-binding
shell: bash

- name: Print Packages Dist Build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
continue-on-error: true
run: tree packages/qwik/dist/

- name: Upload Platform Binding Artifact
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/upload-artifact@v4.3.1
with:
name: dist-bindings-x86_64-unknown-linux-gnu
path: packages/qwik/dist/bindings/*.node
if-no-files-found: error

############ BUILD PLATFORM BINDINGS ############
build-bindings:
strategy:
matrix:
settings:
- host: macos-latest
# looks like that's the last intel macos
- host: macos-13
target: x86_64-apple-darwin
build: pnpm tsm scripts/index.ts --platform-binding

- host: macos-latest
target: aarch64-apple-darwin
build: |
export SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path)
export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version)
pnpm tsm scripts/index.ts --platform-binding --platform-target=aarch64-apple-darwin

- host: windows-latest
target: x86_64-pc-windows-msvc
build: pnpm tsm scripts/index.ts --platform-binding

name: Build ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
Expand All @@ -275,14 +271,10 @@ jobs:

- if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: corepack enable
shell: bash

- name: Install Rust toolchain
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: ${{ matrix.settings.target }}
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Pull Latest Image
if: ${{ needs.changes.outputs.fullbuild == 'true' && matrix.settings.docker }}
Expand All @@ -292,24 +284,6 @@ jobs:
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

- name: Cache cargo dependencies
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-deps-${{ matrix.settings.target }}-${{ hashFiles('Cargo.lock') }}

- name: Cache cargo build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/cache@v4
with:
path: target
key: cargo-build-${{ matrix.settings.target }}-${{ hashFiles('Cargo.lock') }}

- name: Setup Toolchain
if: ${{ needs.changes.outputs.fullbuild == 'true' && matrix.settings.setup }}
run: ${{ matrix.settings.setup }}
Expand All @@ -324,9 +298,14 @@ jobs:
- name: Build Platform Binding
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: ${{ matrix.settings.build }}
run: pnpm tsm scripts/index.ts --platform-binding
shell: bash

- name: Print Packages Dist Build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
continue-on-error: true
run: ls -lR packages/qwik/dist/

- name: Upload Platform Binding Artifact
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/upload-artifact@v4.3.1
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@builder.io/qwik-city": "workspace:^",
"@builder.io/qwik-labs": "workspace:^",
"@builder.io/qwik-react": "workspace:^",
"@builder.io/sdk-qwik": "^0.14.8",
"@builder.io/sdk-qwik": "^0.14.17",
"@docsearch/css": "^3.5.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"files": [
"bindings/qwik.darwin-x64.node",
"bindings/qwik.darwin-arm64.node",
"bindings/qwik.linux-x64-gnu.node",
"bindings/qwik.win32-x64-msvc.node",
"bindings/qwik_wasm_bg.wasm",
"bindings/qwik.wasm.cjs",
Expand Down Expand Up @@ -155,6 +156,7 @@
"core.prod.mjs",
"core.d.ts",
"jsx-dev-runtime/package.json",
"jsx-runtime/package.json",
"jsx-runtime.d.ts",
"loader/index.cjs",
"loader/index.mjs",
Expand Down
Loading

0 comments on commit 63fd3dd

Please sign in to comment.