From fb4486ba4594cbceb738411458961bae9b8d3328 Mon Sep 17 00:00:00 2001 From: Luke Mann Date: Wed, 31 Jan 2024 16:47:13 -0800 Subject: [PATCH] update actions --- .github/workflows/napi.yml | 162 ++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/.github/workflows/napi.yml b/.github/workflows/napi.yml index 5a1291ce..10cb407d 100644 --- a/.github/workflows/napi.yml +++ b/.github/workflows/napi.yml @@ -2,20 +2,20 @@ name: CI env: DEBUG: napi:* APP_NAME: walletkit - MACOSX_DEPLOYMENT_TARGET: "10.13" + MACOSX_DEPLOYMENT_TARGET: '10.13' permissions: contents: write id-token: write -"on": +'on': push: branches: - scaffolding tags-ignore: - - "**" + - '**' paths-ignore: - - "**/*.md" + - '**/*.md' - LICENSE - - "**/*.gitignore" + - '**/*.gitignore' - .editorconfig - docs/** pull_request: null @@ -27,58 +27,58 @@ jobs: settings: - host: macos-latest target: x86_64-apple-darwin - build: yarn build --cargo-cwd walletkit-napi + build: yarn build - host: windows-latest - build: yarn build --cargo-cwd walletkit-napi + build: yarn build target: x86_64-pc-windows-msvc - host: windows-latest build: | - yarn build --cargo-cwd walletkit-napi --target i686-pc-windows-msvc + yarn build --target i686-pc-windows-msvc yarn test target: i686-pc-windows-msvc - host: ubuntu-latest target: x86_64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian - build: yarn build --cargo-cwd walletkit-napi --target x86_64-unknown-linux-gnu + build: yarn build --target x86_64-unknown-linux-gnu - host: ubuntu-latest target: x86_64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - build: yarn build --cargo-cwd walletkit-napi + build: yarn build - host: macos-latest target: aarch64-apple-darwin - build: yarn build --cargo-cwd walletkit-napi --target aarch64-apple-darwin + build: yarn build --target aarch64-apple-darwin - host: ubuntu-latest target: aarch64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 - build: yarn build --cargo-cwd walletkit-napi --target aarch64-unknown-linux-gnu + build: yarn build --target aarch64-unknown-linux-gnu - host: ubuntu-latest target: armv7-unknown-linux-gnueabihf setup: | sudo apt-get update sudo apt-get install gcc-arm-linux-gnueabihf -y - build: yarn build --cargo-cwd walletkit-napi --target armv7-unknown-linux-gnueabihf + build: yarn build --target armv7-unknown-linux-gnueabihf - host: ubuntu-latest target: aarch64-linux-android - build: yarn build --cargo-cwd walletkit-napi --target aarch64-linux-android + build: yarn build --target aarch64-linux-android - host: ubuntu-latest target: armv7-linux-androideabi - build: yarn build --cargo-cwd walletkit-napi --target armv7-linux-androideabi + build: yarn build --target armv7-linux-androideabi - host: ubuntu-latest target: aarch64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine build: |- set -e && rustup target add aarch64-unknown-linux-musl && - yarn build --cargo-cwd walletkit-napi --target aarch64-unknown-linux-musl + yarn build --target aarch64-unknown-linux-musl - host: windows-latest target: aarch64-pc-windows-msvc - build: yarn build --cargo-cwd walletkit-napi --target aarch64-pc-windows-msvc + build: yarn build --target aarch64-pc-windows-msvc - host: ubuntu-latest target: riscv64gc-unknown-linux-gnu setup: | sudo apt-get update sudo apt-get install gcc-riscv64-linux-gnu -y - build: yarn build --cargo-cwd walletkit-napi --target riscv64gc-unknown-linux-gnu + build: yarn build --target riscv64gc-unknown-linux-gnu name: stable - ${{ matrix.settings.target }} - node@20 runs-on: ${{ matrix.settings.host }} steps: @@ -131,7 +131,7 @@ jobs: if: ${{ matrix.settings.docker }} with: image: ${{ matrix.settings.docker }} - options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build" + options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build' run: ${{ matrix.settings.build }} - name: Build run: ${{ matrix.settings.build }} @@ -156,7 +156,7 @@ jobs: RUSTUP_IO_THREADS: 1 with: operating_system: freebsd - version: "13.2" + version: '13.2' memory: 8G cpu_count: 3 environment_variables: DEBUG RUSTUP_IO_THREADS @@ -179,7 +179,7 @@ jobs: env freebsd-version yarn install - yarn build --cargo-cwd walletkit-napi + yarn build yarn test rm -rf node_modules rm -rf target @@ -203,8 +203,8 @@ jobs: - host: windows-latest target: x86_64-pc-windows-msvc node: - - "18" - - "20" + - '18' + - '20' runs-on: ${{ matrix.settings.host }} steps: - uses: actions/checkout@v4 @@ -233,8 +233,8 @@ jobs: fail-fast: false matrix: node: - - "18" - - "20" + - '18' + - '20' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -263,8 +263,8 @@ jobs: fail-fast: false matrix: node: - - "18" - - "20" + - '18' + - '20' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -295,8 +295,8 @@ jobs: fail-fast: false matrix: node: - - "18" - - "20" + - '18' + - '20' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -322,7 +322,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: node:${{ matrix.node }}-slim - options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build" + options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' run: | set -e yarn test @@ -356,7 +356,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: node:lts-alpine - options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build" + options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' run: | set -e yarn test @@ -368,8 +368,8 @@ jobs: fail-fast: false matrix: node: - - "18" - - "20" + - '18' + - '20' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -394,7 +394,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: node:${{ matrix.node }}-bullseye-slim - options: "--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build" + options: '--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build' run: | set -e yarn test @@ -431,50 +431,50 @@ jobs: name: bindings-universal-apple-darwin path: ${{ env.APP_NAME }}.*.node if-no-files-found: error - # publish: - # name: Publish - # runs-on: ubuntu-latest - # needs: - # - build-freebsd - # - test-macOS-windows-binding - # - test-linux-x64-gnu-binding - # - test-linux-x64-musl-binding - # - test-linux-aarch64-gnu-binding - # - test-linux-aarch64-musl-binding - # - test-linux-arm-gnueabihf-binding - # - universal-macOS - # steps: - # - uses: actions/checkout@v4 - # - name: Setup node - # uses: actions/setup-node@v4 - # with: - # node-version: 20 - # cache: yarn - # - name: Install dependencies - # run: yarn install - # - name: Download all artifacts - # uses: actions/download-artifact@v4 - # with: - # path: artifacts - # - name: Move artifacts - # run: yarn artifacts - # - name: List packages - # run: ls -R ./npm - # shell: bash - # - name: Publish - # run: | - # npm config set provenance true - # if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; - # then - # echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - # npm publish --access public - # elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+"; - # then - # echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - # npm publish --tag next --access public - # else - # echo "Not a release, skipping publish" - # fi - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + publish: + name: Publish + runs-on: ubuntu-latest + needs: + - build-freebsd + - test-macOS-windows-binding + - test-linux-x64-gnu-binding + - test-linux-x64-musl-binding + - test-linux-aarch64-gnu-binding + - test-linux-aarch64-musl-binding + - test-linux-arm-gnueabihf-binding + - universal-macOS + steps: + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + - name: Install dependencies + run: yarn install + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Move artifacts + run: yarn artifacts + - name: List packages + run: ls -R ./npm + shell: bash + - name: Publish + run: | + npm config set provenance true + if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; + then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --access public + elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+"; + then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --tag next --access public + else + echo "Not a release, skipping publish" + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}