update to new action-setup #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build PDF Runtime | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - 'packages/pdf-runtime/**' | |
| - '.github/workflows/build-pdf-runtime.yml' | |
| push: | |
| branches: | |
| - main | |
| - next | |
| - feature/pdf-runtime | |
| paths: | |
| - 'packages/pdf-runtime/**' | |
| - '.github/workflows/build-pdf-runtime.yml' | |
| permissions: | |
| contents: read | |
| env: | |
| EMSDK_VERSION: 3.1.72 | |
| jobs: | |
| linux: | |
| name: Linux x64 + musl + WASM | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [linux-x64, linuxmusl-x64, wasm32] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10.4.0 | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| run: pnpm install --frozen-lockfile | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| name: Install build tools | |
| run: sudo apt-get update && sudo apt-get install -y cmake clang lld | |
| - if: matrix.target == 'wasm32' | |
| name: Install Emscripten | |
| run: | | |
| git clone https://github.com/emscripten-core/emsdk.git "$RUNNER_TEMP/emsdk" | |
| "$RUNNER_TEMP/emsdk/emsdk" install "$EMSDK_VERSION" | |
| "$RUNNER_TEMP/emsdk/emsdk" activate "$EMSDK_VERSION" | |
| echo "$RUNNER_TEMP/emsdk/upstream/emscripten" >> "$GITHUB_PATH" | |
| echo "$RUNNER_TEMP/emsdk/upstream/bin" >> "$GITHUB_PATH" | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| name: Build target | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| LDFLAGS: -fuse-ld=lld | |
| run: pnpm --filter @embedpdf/pdf-runtime build:target ${{ matrix.target }} | |
| - if: ${{ contains(matrix.target, 'linuxmusl') }} | |
| name: Build musl target in Alpine | |
| run: | | |
| docker run --rm \ | |
| -v "$GITHUB_WORKSPACE:/workspace" \ | |
| -w /workspace \ | |
| node:22-alpine \ | |
| sh -lc "apk add --no-cache bash cmake clang g++ make python3 curl tar git && corepack enable && pnpm install --frozen-lockfile && pnpm --filter @embedpdf/pdf-runtime build:target ${{ matrix.target }}" | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pdf-runtime-${{ matrix.target }} | |
| path: packages/pdf-runtime/npm/${{ matrix.target }}/ | |
| linux-arm: | |
| name: Linux arm64 + musl | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [linux-arm64, linuxmusl-arm64] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10.4.0 | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| run: pnpm install --frozen-lockfile | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| name: Install build tools | |
| run: sudo apt-get update && sudo apt-get install -y cmake clang lld | |
| - if: ${{ !contains(matrix.target, 'linuxmusl') }} | |
| name: Build target | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| LDFLAGS: -fuse-ld=lld | |
| run: pnpm --filter @embedpdf/pdf-runtime build:target ${{ matrix.target }} | |
| - if: ${{ contains(matrix.target, 'linuxmusl') }} | |
| name: Build musl target in Alpine | |
| run: | | |
| docker run --rm \ | |
| -v "$GITHUB_WORKSPACE:/workspace" \ | |
| -w /workspace \ | |
| node:22-alpine \ | |
| sh -lc "apk add --no-cache bash cmake clang g++ make python3 curl tar git && corepack enable && pnpm install --frozen-lockfile && pnpm --filter @embedpdf/pdf-runtime build:target ${{ matrix.target }}" | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pdf-runtime-${{ matrix.target }} | |
| path: packages/pdf-runtime/npm/${{ matrix.target }}/ | |
| mac: | |
| name: macOS | |
| runs-on: macos-14 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [darwin-arm64, darwin-x64] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10.4.0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build target | |
| run: pnpm --filter @embedpdf/pdf-runtime build:target ${{ matrix.target }} | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pdf-runtime-${{ matrix.target }} | |
| path: packages/pdf-runtime/npm/${{ matrix.target }}/ | |
| win: | |
| name: Windows | |
| runs-on: windows-2022 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [win32-x64, win32-arm64] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10.4.0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build target | |
| shell: bash | |
| run: pnpm --filter @embedpdf/pdf-runtime build:target ${{ matrix.target }} | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pdf-runtime-${{ matrix.target }} | |
| path: packages/pdf-runtime/npm/${{ matrix.target }}/ |