From 6e5c7f34f368f5159ea3a14047755b6ae99fe37a Mon Sep 17 00:00:00 2001 From: Andrew Molchanov Date: Sun, 12 Jan 2025 16:32:20 +0300 Subject: [PATCH] release --- .github/workflows/CI.yml | 268 +++++++++++++++++++-------------------- 1 file changed, 133 insertions(+), 135 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ce48e47..ab084f8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ on: push: branches: - main - - testing + - next tags-ignore: - "**" paths-ignore: @@ -21,150 +21,148 @@ on: - docs/** pull_request: null jobs: - # build: - # strategy: - # fail-fast: false - # matrix: - # settings: - # - host: macos-latest - # target: x86_64-apple-darwin - # build: yarn build --target x86_64-apple-darwin - # - host: windows-latest - # build: yarn build --target x86_64-pc-windows-msvc - # target: x86_64-pc-windows-msvc - # - host: ubuntu-latest - # target: x86_64-unknown-linux-gnu - # build: yarn build --target x86_64-unknown-linux-gnu - # name: stable - ${{ matrix.settings.target }} - node@22 - # runs-on: ${{ matrix.settings.host }} - # steps: - # - uses: actions/checkout@v4 - # - name: Setup node - # uses: actions/setup-node@v4 - # if: ${{ !matrix.settings.docker }} - # with: - # node-version: 22 - # cache: yarn - # - name: Install - # uses: dtolnay/rust-toolchain@stable - # if: ${{ !matrix.settings.docker }} - # with: - # toolchain: stable - # targets: ${{ matrix.settings.target }} - # - name: Cache cargo - # uses: actions/cache@v4 - # with: - # path: | - # ~/.cargo/registry/index/ - # ~/.cargo/registry/cache/ - # ~/.cargo/git/db/ - # .cargo-cache - # target/ - # key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} - # - uses: goto-bus-stop/setup-zig@v2 - # if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' || matrix.settings.target == 'armv7-unknown-linux-musleabihf' }} - # with: - # version: 0.13.0 - # - name: Setup toolchain - # run: ${{ matrix.settings.setup }} - # if: ${{ matrix.settings.setup }} - # shell: bash - # - name: Setup node x86 - # if: matrix.settings.target == 'i686-pc-windows-msvc' - # run: yarn config set supportedArchitectures.cpu "ia32" - # shell: bash - # - name: Install linux dependencies - # if: matrix.settings.host == 'ubuntu-latest' - # run: | - # sudo apt update - # sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev - # - name: Install dependencies - # run: yarn install - # - name: Setup node x86 - # uses: actions/setup-node@v4 - # if: matrix.settings.target == 'i686-pc-windows-msvc' - # with: - # node-version: 22 - # cache: yarn - # architecture: x86 - # - name: Build - # run: ${{ matrix.settings.build }} - # shell: bash - # - name: Upload artifact - # uses: actions/upload-artifact@v4 - # with: - # name: bindings-${{ matrix.settings.target }} - # path: ${{ env.APP_NAME }}.*.node - # if-no-files-found: error - # test-bindings: - # name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} - # needs: - # - build - # strategy: - # fail-fast: false - # matrix: - # settings: - # - host: macos-latest - # target: x86_64-apple-darwin - # - host: windows-latest - # target: x86_64-pc-windows-msvc - # # - host: ubuntu-latest - # # target: x86_64-unknown-linux-gnu - # node: - # - "22" - # runs-on: ${{ matrix.settings.host }} - # steps: - # - uses: actions/checkout@v4 - # - name: Setup node - # uses: actions/setup-node@v4 - # with: - # node-version: ${{ matrix.node }} - # cache: yarn - # architecture: x64 - # - name: Install dependencies - # run: yarn install - # - name: Download artifacts - # uses: actions/download-artifact@v4 - # with: - # name: bindings-${{ matrix.settings.target }} - # path: . - # - name: Install linux dependencies - # if: matrix.settings.host == 'ubuntu-latest' - # run: | - # sudo apt update - # sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev - # - name: Test bindings - # run: yarn test + build: + strategy: + fail-fast: false + matrix: + settings: + - host: macos-latest + target: x86_64-apple-darwin + build: yarn build --target x86_64-apple-darwin + - host: windows-latest + build: yarn build --target x86_64-pc-windows-msvc + target: x86_64-pc-windows-msvc + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + build: yarn build --target x86_64-unknown-linux-gnu + name: stable - ${{ matrix.settings.target }} - node@22 + runs-on: ${{ matrix.settings.host }} + steps: + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + if: ${{ !matrix.settings.docker }} + with: + node-version: 22 + cache: yarn + - name: Install + uses: dtolnay/rust-toolchain@stable + if: ${{ !matrix.settings.docker }} + with: + toolchain: stable + targets: ${{ matrix.settings.target }} + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + .cargo-cache + target/ + key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} + - uses: goto-bus-stop/setup-zig@v2 + if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' || matrix.settings.target == 'armv7-unknown-linux-musleabihf' }} + with: + version: 0.13.0 + - name: Setup toolchain + run: ${{ matrix.settings.setup }} + if: ${{ matrix.settings.setup }} + shell: bash + - name: Setup node x86 + if: matrix.settings.target == 'i686-pc-windows-msvc' + run: yarn config set supportedArchitectures.cpu "ia32" + shell: bash + - name: Install linux dependencies + if: matrix.settings.host == 'ubuntu-latest' + run: | + sudo apt update + sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev + - name: Install dependencies + run: yarn install + - name: Setup node x86 + uses: actions/setup-node@v4 + if: matrix.settings.target == 'i686-pc-windows-msvc' + with: + node-version: 22 + cache: yarn + architecture: x86 + - name: Build + run: ${{ matrix.settings.build }} + shell: bash + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: ${{ env.APP_NAME }}.*.node + if-no-files-found: error + test-bindings: + name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + settings: + - host: macos-latest + target: x86_64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + # - host: ubuntu-latest + # target: x86_64-unknown-linux-gnu + node: + - "22" + runs-on: ${{ matrix.settings.host }} + steps: + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: yarn + architecture: x64 + - name: Install dependencies + run: yarn install + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: . + - name: Install linux dependencies + if: matrix.settings.host == 'ubuntu-latest' + run: | + sudo apt update + sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev + - name: Test bindings + run: yarn test publish: name: Publish runs-on: ubuntu-latest - # needs: - # - test-bindings + needs: + - test-bindings steps: - # - uses: actions/checkout@v4 - # - name: Setup node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # 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 + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + 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: Publish run: | npm config set provenance true echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then - echo "On main branch, publishing with public access..." - # npm publish --access public + npm publish --access public elif [[ "${GITHUB_REF}" == "refs/heads/next" ]]; then - echo "On next branch, publishing with 'next' tag..." - # npm publish --tag next --access public + npm publish --tag next --access public else echo "Not on a release branch, skipping publish" fi