|
| 1 | +on: |
| 2 | + pull_request: |
| 3 | + branches: [main] |
| 4 | + workflow_dispatch: {} |
| 5 | + workflow_call: {} |
| 6 | + |
| 7 | +name: Build |
| 8 | + |
| 9 | +jobs: |
| 10 | + host_tests: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: [macos-latest, windows-2019] |
| 14 | + fail-fast: false |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: 16.20.1 |
| 22 | + cache: "npm" |
| 23 | + registry-url: "https://registry.npmjs.org" |
| 24 | + |
| 25 | + - name: Install zstd |
| 26 | + run: npm run install-zstd |
| 27 | + shell: bash |
| 28 | + |
| 29 | + - name: install dependencies and compile |
| 30 | + run: npm install --loglevel verbose && npm run prebuild |
| 31 | + shell: bash |
| 32 | + |
| 33 | + - id: upload |
| 34 | + name: Upload prebuild |
| 35 | + uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: build-${{ matrix.os }} |
| 38 | + path: prebuilds/ |
| 39 | + if-no-files-found: "error" |
| 40 | + retention-days: 1 |
| 41 | + compression-level: 0 |
| 42 | + |
| 43 | + container_tests_glibc: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + strategy: |
| 46 | + matrix: |
| 47 | + linux_arch: [s390x, arm64, amd64] |
| 48 | + fail-fast: false |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - uses: actions/setup-node@v4 |
| 53 | + with: |
| 54 | + node-version: ${{ matrix.node }} |
| 55 | + |
| 56 | + - name: Set up QEMU |
| 57 | + uses: docker/setup-qemu-action@v3 |
| 58 | + |
| 59 | + - name: Set up Docker Buildx |
| 60 | + uses: docker/setup-buildx-action@v3 |
| 61 | + |
| 62 | + - name: Run Buildx |
| 63 | + run: | |
| 64 | + docker buildx create --name builder --bootstrap --use |
| 65 | + docker buildx build \ |
| 66 | + --platform linux/${{ matrix.linux_arch }} \ |
| 67 | + --build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \ |
| 68 | + --build-arg="NODE_VERSION=16.20.1" \ |
| 69 | + --output type=local,dest=./prebuilds,platform-split=false \ |
| 70 | + -f ./.github/docker/Dockerfile.glibc \ |
| 71 | + . |
| 72 | +
|
| 73 | + - id: upload |
| 74 | + name: Upload prebuild |
| 75 | + uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: build-linux-glibc-${{ matrix.linux_arch }} |
| 78 | + path: prebuilds/ |
| 79 | + if-no-files-found: "error" |
| 80 | + retention-days: 1 |
| 81 | + compression-level: 0 |
| 82 | + |
| 83 | + container_tests_musl: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + strategy: |
| 86 | + matrix: |
| 87 | + linux_arch: [amd64, arm64] |
| 88 | + fail-fast: false |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + |
| 92 | + - uses: actions/setup-node@v4 |
| 93 | + with: |
| 94 | + node-version: ${{ matrix.node }} |
| 95 | + |
| 96 | + - name: Set up QEMU |
| 97 | + uses: docker/setup-qemu-action@v3 |
| 98 | + |
| 99 | + - name: Set up Docker Buildx |
| 100 | + uses: docker/setup-buildx-action@v3 |
| 101 | + |
| 102 | + - name: Run Buildx |
| 103 | + run: | |
| 104 | + docker buildx create --name builder --bootstrap --use |
| 105 | + docker --debug buildx build --progress=plain --no-cache \ |
| 106 | + --platform linux/${{ matrix.linux_arch }} \ |
| 107 | + --build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \ |
| 108 | + --build-arg="NODE_VERSION=16.20.1" \ |
| 109 | + --output type=local,dest=./prebuilds,platform-split=false \ |
| 110 | + -f ./.github/docker/Dockerfile.musl \ |
| 111 | + . |
| 112 | +
|
| 113 | + - id: upload |
| 114 | + name: Upload prebuild |
| 115 | + uses: actions/upload-artifact@v4 |
| 116 | + with: |
| 117 | + name: build-linux-musl-${{ matrix.linux_arch }} |
| 118 | + path: prebuilds/ |
| 119 | + if-no-files-found: "error" |
| 120 | + retention-days: 1 |
| 121 | + compression-level: 0 |
0 commit comments