From 6a6181d0925a592e44e899305b4dff4fccd28b11 Mon Sep 17 00:00:00 2001 From: Andrew Molchanov Date: Sun, 12 Jan 2025 16:20:24 +0300 Subject: [PATCH] test condition --- .github/workflows/CI.yml | 275 ++++++++++++++++++++------------------- 1 file changed, 139 insertions(+), 136 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c829863..3f83fcb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - next tags-ignore: - "**" paths-ignore: @@ -20,151 +21,153 @@ 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 - if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + echo ${{ github.ref_name }} + if ${{ github.ref_name }} == "main"; 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]\+"; + # npm publish --access public + echo "Published main" + elif ${{ github.ref_name }} == "next"; then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --tag next --access public + # npm publish --tag next --access public + echo "Published next" else echo "Not a release, skipping publish" fi