From dec9035ac72692a919c1dcc80958a359130cef56 Mon Sep 17 00:00:00 2001 From: Monica Olejniczak Date: Mon, 15 Jul 2024 14:25:33 +1000 Subject: [PATCH] . --- .github/workflows/release.yml | 386 +++++++++++++++++----------------- 1 file changed, 193 insertions(+), 193 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e422d917d3d..a632582dbb7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,71 +26,71 @@ permissions: contents: read # for actions/checkout jobs: - build-macos-windows: - strategy: - fail-fast: false - matrix: - include: - - name: aarch64-apple-darwin - os: macos-latest - target: aarch64-apple-darwin + # build-macos-windows: + # strategy: + # fail-fast: false + # matrix: + # include: + # - name: aarch64-apple-darwin + # os: macos-latest + # target: aarch64-apple-darwin - - name: x86_64-apple-darwin - os: macos-latest - target: x86_64-apple-darwin + # - name: x86_64-apple-darwin + # os: macos-latest + # target: x86_64-apple-darwin - - name: windows-latest - os: windows-latest - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - target: ${{ matrix.target }} - - uses: bahmutov/npm-install@v1.8.35 - - uses: Swatinem/rust-cache@v2 - if: ${{ inputs.type != 'latest' }} - with: - shared-key: ${{ matrix.name }} - - name: Remove CommandLineTools SDKs - if: ${{ matrix.target == 'aarch64-apple-darwin' }} - run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; - - name: Build native packages - run: yarn build-native-${{ inputs.profile }} - env: - RUST_TARGET: ${{ matrix.target }} - - name: Extract debug symbols - if: ${{ runner.os == 'macOS' && inputs.profile == 'canary' }} - run: dsymutil packages/*/*/*.node - - name: Upload debug symbols - uses: actions/upload-artifact@v3 - if: ${{ inputs.profile == 'canary' }} - with: - name: debug-symbols-${{ matrix.name }} - path: packages/*/*/*.node.dSYM/Contents/Resources/DWARF/*.node - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 - if: ${{ runner.os == 'macOS' }} - run: strip -x packages/*/*/*.node # Must use -x on macOS. This produces larger results on linux. - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: bindings-${{ matrix.name }} - path: packages/*/*/*.node - - name: Debug - if: ${{ runner.os == 'macOS' }} - run: ls -l packages/*/*/*.node - - name: Smoke test - if: ${{ !matrix.target }} - run: node -e "require('@parcel/rust')" + # - name: windows-latest + # os: windows-latest + # name: ${{ matrix.name }} + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v4 + # - name: Install Rust + # uses: dtolnay/rust-toolchain@master + # with: + # toolchain: stable + # target: ${{ matrix.target }} + # - uses: bahmutov/npm-install@v1.8.35 + # - uses: Swatinem/rust-cache@v2 + # if: ${{ inputs.type != 'latest' }} + # with: + # shared-key: ${{ matrix.name }} + # - name: Remove CommandLineTools SDKs + # if: ${{ matrix.target == 'aarch64-apple-darwin' }} + # run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; + # - name: Build native packages + # run: yarn build-native-${{ inputs.profile }} + # env: + # RUST_TARGET: ${{ matrix.target }} + # - name: Extract debug symbols + # if: ${{ runner.os == 'macOS' && inputs.profile == 'canary' }} + # run: dsymutil packages/*/*/*.node + # - name: Upload debug symbols + # uses: actions/upload-artifact@v3 + # if: ${{ inputs.profile == 'canary' }} + # with: + # name: debug-symbols-${{ matrix.name }} + # path: packages/*/*/*.node.dSYM/Contents/Resources/DWARF/*.node + # - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 + # if: ${{ runner.os == 'macOS' }} + # run: strip -x packages/*/*/*.node # Must use -x on macOS. This produces larger results on linux. + # - name: Upload artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: bindings-${{ matrix.name }} + # path: packages/*/*/*.node + # - name: Debug + # if: ${{ runner.os == 'macOS' }} + # run: ls -l packages/*/*/*.node + # - name: Smoke test + # if: ${{ !matrix.target }} + # run: node -e "require('@parcel/rust')" build-linux-gnu-x64: name: linux-gnu-x64 runs-on: ubuntu-20.04 container: - image: node:22.4-bookworm + image: node:18.20-alpine steps: - uses: actions/checkout@v3 - name: Install Rust @@ -126,144 +126,144 @@ jobs: - name: Smoke test run: node -e 'require("@parcel/rust")' - build-linux-gnu-arm: - strategy: - fail-fast: false - matrix: - include: - - target: arm-unknown-linux-gnueabihf - arch: armhf - strip: arm-linux-gnueabihf-strip - objcopy: arm-linux-gnueabihf-objcopy - cflags: -mfpu=neon - - target: aarch64-unknown-linux-gnu - arch: arm64 - strip: aarch64-linux-gnu-strip - objcopy: aarch64-linux-gnu-objcopy - cflags: '' - name: ${{ matrix.target }} - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - target: ${{ matrix.target }} - - name: Install cross compile toolchains - run: | - sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y - - uses: bahmutov/npm-install@v1.8.35 - - uses: Swatinem/rust-cache@v2 - if: ${{ inputs.type != 'latest' }} - with: - shared-key: ${{ matrix.target }} - - name: Build native packages - run: yarn build-native-${{ inputs.profile }} - env: - RUST_TARGET: ${{ matrix.target }} - CFLAGS: ${{ matrix.cflags }} - - name: Extract debug symbols - if: ${{ inputs.profile == 'canary' }} - run: | - find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --only-keep-debug --compress-debug-sections=zlib {} {}.debug \; - find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --strip-debug --strip-unneeded {} \; - find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --add-gnu-debuglink={}.debug {} \; - - name: Upload debug symbols - uses: actions/upload-artifact@v3 - if: ${{ inputs.profile == 'canary' }} - with: - name: debug-symbols-${{ matrix.target }} - path: packages/*/*/*.node.debug - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 - run: ${{ matrix.strip }} packages/*/*/*.node - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: bindings-${{ matrix.target }} - path: packages/*/*/*.node - - name: debug - run: ls -l packages/*/*/*.node - - name: Configure binfmt-support - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - name: Smoke test - uses: addnab/docker-run-action@v1 - with: - image: ghcr.io/devongovett/multiarch-node:node14-${{ matrix.arch }}-focal - options: -v ${{github.workspace}}:/work - run: cd /work && node -e "require('@parcel/rust')" + # build-linux-gnu-arm: + # strategy: + # fail-fast: false + # matrix: + # include: + # - target: arm-unknown-linux-gnueabihf + # arch: armhf + # strip: arm-linux-gnueabihf-strip + # objcopy: arm-linux-gnueabihf-objcopy + # cflags: -mfpu=neon + # - target: aarch64-unknown-linux-gnu + # arch: arm64 + # strip: aarch64-linux-gnu-strip + # objcopy: aarch64-linux-gnu-objcopy + # cflags: '' + # name: ${{ matrix.target }} + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v4 + # - name: Install Rust + # uses: dtolnay/rust-toolchain@master + # with: + # toolchain: stable + # target: ${{ matrix.target }} + # - name: Install cross compile toolchains + # run: | + # sudo apt-get update + # sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y + # - uses: bahmutov/npm-install@v1.8.35 + # - uses: Swatinem/rust-cache@v2 + # if: ${{ inputs.type != 'latest' }} + # with: + # shared-key: ${{ matrix.target }} + # - name: Build native packages + # run: yarn build-native-${{ inputs.profile }} + # env: + # RUST_TARGET: ${{ matrix.target }} + # CFLAGS: ${{ matrix.cflags }} + # - name: Extract debug symbols + # if: ${{ inputs.profile == 'canary' }} + # run: | + # find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --only-keep-debug --compress-debug-sections=zlib {} {}.debug \; + # find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --strip-debug --strip-unneeded {} \; + # find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --add-gnu-debuglink={}.debug {} \; + # - name: Upload debug symbols + # uses: actions/upload-artifact@v3 + # if: ${{ inputs.profile == 'canary' }} + # with: + # name: debug-symbols-${{ matrix.target }} + # path: packages/*/*/*.node.debug + # - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 + # run: ${{ matrix.strip }} packages/*/*/*.node + # - name: Upload artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: bindings-${{ matrix.target }} + # path: packages/*/*/*.node + # - name: debug + # run: ls -l packages/*/*/*.node + # - name: Configure binfmt-support + # run: docker run --rm --privileged multiarch/qemu-user-static:register --reset + # - name: Smoke test + # uses: addnab/docker-run-action@v1 + # with: + # image: ghcr.io/devongovett/multiarch-node:node14-${{ matrix.arch }}-focal + # options: -v ${{github.workspace}}:/work + # run: cd /work && node -e "require('@parcel/rust')" - build-linux-musl: - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-musl - strip: strip - objcopy: objcopy - cflags: -msse4.2 - arch: x86_64 - - target: aarch64-unknown-linux-musl - strip: aarch64-linux-musl-strip - objcopy: aarch64-linux-musl-objcopy - cflags: '' - arch: aarch64 - name: ${{ matrix.target }} - runs-on: ubuntu-20.04 - container: - image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:5a99e45446355d25c20e95d35231d84e9ce472280d8c0b1be53281bade905f09 - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GHCR_TOKEN }} - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: apk add --no-cache python3 make gcc g++ musl-dev curl openssl - - name: Install Rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - target: ${{ matrix.target }} - - uses: bahmutov/npm-install@v1.8.35 - - name: Build native packages - run: yarn build-native-${{ inputs.profile }} - env: - RUST_TARGET: ${{ matrix.target }} - CFLAGS: ${{ matrix.cflags }} - - name: Extract debug symbols - if: ${{ inputs.profile == 'canary' }} - run: | - find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --only-keep-debug --compress-debug-sections=zlib {} {}.debug \; - find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --strip-debug --strip-unneeded {} \; - find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --add-gnu-debuglink={}.debug {} \; - - name: Upload debug symbols - uses: actions/upload-artifact@v3 - if: ${{ inputs.profile == 'canary' }} - with: - name: debug-symbols-linux-musl-${{ matrix.arch }} - path: packages/*/*/*.node.debug - - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 - run: ${{ matrix.strip }} packages/*/*/*.node - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: bindings-linux-musl-${{ matrix.arch }} - path: packages/*/*/*.node - - name: debug - run: ls -l packages/*/*/*.node - - name: Smoke test - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} - run: node -e 'require("@parcel/rust")' + # build-linux-musl: + # strategy: + # fail-fast: false + # matrix: + # include: + # - target: x86_64-unknown-linux-musl + # strip: strip + # objcopy: objcopy + # cflags: -msse4.2 + # arch: x86_64 + # - target: aarch64-unknown-linux-musl + # strip: aarch64-linux-musl-strip + # objcopy: aarch64-linux-musl-objcopy + # cflags: '' + # arch: aarch64 + # name: ${{ matrix.target }} + # runs-on: ubuntu-20.04 + # container: + # image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:5a99e45446355d25c20e95d35231d84e9ce472280d8c0b1be53281bade905f09 + # credentials: + # username: ${{ github.actor }} + # password: ${{ secrets.GHCR_TOKEN }} + # steps: + # - uses: actions/checkout@v4 + # - name: Install build tools + # run: apk add --no-cache python3 make gcc g++ musl-dev curl openssl + # - name: Install Rust + # uses: dtolnay/rust-toolchain@master + # with: + # toolchain: stable + # target: ${{ matrix.target }} + # - uses: bahmutov/npm-install@v1.8.35 + # - name: Build native packages + # run: yarn build-native-${{ inputs.profile }} + # env: + # RUST_TARGET: ${{ matrix.target }} + # CFLAGS: ${{ matrix.cflags }} + # - name: Extract debug symbols + # if: ${{ inputs.profile == 'canary' }} + # run: | + # find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --only-keep-debug --compress-debug-sections=zlib {} {}.debug \; + # find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --strip-debug --strip-unneeded {} \; + # find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --add-gnu-debuglink={}.debug {} \; + # - name: Upload debug symbols + # uses: actions/upload-artifact@v3 + # if: ${{ inputs.profile == 'canary' }} + # with: + # name: debug-symbols-linux-musl-${{ matrix.arch }} + # path: packages/*/*/*.node.debug + # - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034 + # run: ${{ matrix.strip }} packages/*/*/*.node + # - name: Upload artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: bindings-linux-musl-${{ matrix.arch }} + # path: packages/*/*/*.node + # - name: debug + # run: ls -l packages/*/*/*.node + # - name: Smoke test + # if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + # run: node -e 'require("@parcel/rust")' build-and-release: runs-on: ubuntu-20.04 name: Build and release needs: - - build-linux-gnu-arm + # - build-linux-gnu-arm - build-linux-gnu-x64 - - build-linux-musl - - build-macos-windows + # - build-linux-musl + # - build-macos-windows steps: - uses: actions/checkout@v4 with: @@ -271,10 +271,6 @@ jobs: - uses: bahmutov/npm-install@v1.8.35 - name: Build native packages run: yarn build-native-${{ inputs.profile }} - - name: Build node packages - run: yarn build - - name: Build TypeScript types - run: yarn build-ts - name: Download artifacts uses: actions/download-artifact@v3 with: @@ -297,6 +293,10 @@ jobs: - name: Debug run: | ls -l packages/*/*/*.node + - name: Build node packages + run: yarn build + - name: Build TypeScript types + run: yarn build-ts - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}