/
githubmirror
/
tauri
Обзор
Документация
Войти
/
githubmirror
/
tauri
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
.github/workflows/publish-cli-js.yml
293 строки
9 KB
Fabian-Lars
ci: always test armv7 cli on node 22
27 июл 2026, 11:23
Не верифицирован
27 июл 2026, 11:23
2e763a7
Код
Авторство
О чём код?
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT name: publish `@tauri-apps/cli` env: DEBUG: napi:* APP_NAME: cli MACOSX_DEPLOYMENT_TARGET: '10.13' on: workflow_dispatch: inputs: releaseId: description: 'ID of the `@tauri-apps/cli` release' required: true repository_dispatch: types: [publish-js-cli] defaults: run: working-directory: packages/cli/ permissions: contents: write # update release id-token: write # oidc token jobs: build: strategy: fail-fast: false matrix: settings: - host: macos-latest target: x86_64-apple-darwin build: pnpm build --target=x86_64-apple-darwin - host: macos-latest target: aarch64-apple-darwin build: pnpm build --target=aarch64-apple-darwin - host: windows-latest build: pnpm build --target=x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc - host: windows-latest build: pnpm build --target=i686-pc-windows-msvc target: i686-pc-windows-msvc - host: windows-latest target: aarch64-pc-windows-msvc build: pnpm build --target=aarch64-pc-windows-msvc - host: ubuntu-latest target: x86_64-unknown-linux-gnu build: pnpm build --target=x86_64-unknown-linux-gnu --cross-compile - host: ubuntu-latest target: x86_64-unknown-linux-musl build: pnpm build --target=x86_64-unknown-linux-musl --cross-compile - host: ubuntu-latest target: aarch64-unknown-linux-gnu build: pnpm build --target=aarch64-unknown-linux-gnu --cross-compile setup: | sudo apt-get update sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y - host: ubuntu-latest target: armv7-unknown-linux-gnueabihf build: pnpm build --target=armv7-unknown-linux-gnueabihf --cross-compile - host: ubuntu-latest target: aarch64-unknown-linux-musl build: pnpm build --target=aarch64-unknown-linux-musl --cross-compile - host: ubuntu-latest target: riscv64gc-unknown-linux-gnu build: pnpm build --target=riscv64gc-unknown-linux-gnu --cross-compile setup: | sudo apt-get update sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y name: stable - ${{ matrix.settings.target }} - node@22 runs-on: ${{ matrix.settings.host }} steps: - uses: actions/checkout@v7 - run: npm i -g --force corepack - name: Setup node uses: actions/setup-node@v7 if: ${{ !matrix.settings.docker }} with: node-version: 22 cache: 'pnpm' - name: Install Rust uses: dtolnay/rust-toolchain@stable with: # CEF helper needs both archs targets: ${{ contains(matrix.settings.target, 'apple-darwin') && 'aarch64-apple-darwin,x86_64-apple-darwin' || matrix.settings.target }} - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.settings.target }} - uses: mlugg/setup-zig@v2 if: ${{ contains(matrix.settings.target, 'linux') }} with: version: 0.14.1 - name: Install cargo-zigbuild uses: taiki-e/install-action@v2 if: ${{ contains(matrix.settings.target, 'linux') }} env: GITHUB_TOKEN: ${{ github.token }} with: tool: cargo-zigbuild - name: Setup toolchain run: ${{ matrix.settings.setup }} if: ${{ matrix.settings.setup }} shell: bash - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - name: Build run: ${{ matrix.settings.build }} shell: bash - name: Upload artifact uses: actions/upload-artifact@v7 with: name: bindings-${{ matrix.settings.target }} path: packages/cli/${{ env.APP_NAME }}.*.node if-no-files-found: error test-macOS-windows-binding: name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} needs: - build strategy: fail-fast: false matrix: settings: - host: macos-latest target: aarch64-apple-darwin architecture: arm64 - host: windows-latest target: x86_64-pc-windows-msvc architecture: x64 - host: windows-11-arm target: aarch64-pc-windows-msvc architecture: arm64 - host: macos-latest target: x86_64-apple-darwin architecture: x64 node: - '22' - '24' runs-on: ${{ matrix.settings.host }} steps: - uses: actions/checkout@v7 - run: npm i -g --force corepack - name: Setup node uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: pnpm architecture: ${{ matrix.settings.architecture }} - name: Install dependencies run: pnpm install --frozen-lockfile --ignore-scripts - name: Download artifacts uses: actions/download-artifact@v8 with: name: bindings-${{ matrix.settings.target }} path: 'packages/cli/' - name: List packages run: ls -R . shell: bash - name: Test bindings run: pnpm test test-linux-binding: name: Test ${{ matrix.target }} - node@${{ matrix.node }} needs: - build strategy: fail-fast: false matrix: target: - x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl - aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl - armv7-unknown-linux-gnueabihf node: - '22' - '24' runs-on: ${{ contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v7 - run: npm i -g --force corepack - name: Setup node uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: pnpm architecture: ${{ contains(matrix.target, 'aarch64') && 'arm64' || 'x64' }} - name: Install dependencies run: pnpm install --frozen-lockfile --ignore-scripts - name: Download artifacts uses: actions/download-artifact@v8 with: name: bindings-${{ matrix.target }} path: 'packages/cli/' - name: List packages run: ls -R . shell: bash - name: install system dependencies (gnu) if: ${{ endsWith(matrix.target, 'gnu') }} run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev - name: Setup and run tests (gnu) if: ${{ endsWith(matrix.target, 'gnu') }} run: pnpm test # TODO: Actually run tests on musl and armv7 - name: Output docker params id: docker if: ${{ contains(matrix.target, 'musl') || contains(matrix.target, 'armv7') }} run: | node -e " if ('${{ matrix.target }}'.startsWith('aarch64')) { console.log('PLATFORM=linux/arm64') } else if ('${{ matrix.target }}'.startsWith('armv7')) { console.log('PLATFORM=linux/arm/v7') } else { console.log('PLATFORM=linux/amd64') } " >> $GITHUB_OUTPUT node -e " if ('${{ matrix.target }}'.endsWith('-musl')) { console.log('IMAGE=node:${{ matrix.node }}-alpine') } else { console.log('IMAGE=node:22-slim') } " >> $GITHUB_OUTPUT - name: Set up QEMU (armv7) uses: docker/setup-qemu-action@v4 if: ${{ contains(matrix.target, 'armv7') }} with: platforms: all - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes if: ${{ contains(matrix.target, 'armv7') }} - name: Setup and run tests (musl | armv7) uses: addnab/docker-run-action@v3 if: ${{ contains(matrix.target, 'musl') || contains(matrix.target, 'armv7') }} with: image: ${{ steps.docker.outputs.IMAGE }} options: --volume ${{ github.workspace }}:${{ github.workspace }} --workdir ${{ github.workspace }}/packages/cli --platform ${{ steps.docker.outputs.PLATFORM }} shell: sh run: | set -e node tauri.js --help ls -la publish: name: Publish runs-on: ubuntu-latest needs: - test-macOS-windows-binding - test-linux-binding steps: - uses: actions/checkout@v7 - run: npm i -g --force corepack - name: Setup node uses: actions/setup-node@v7 with: node-version: 24 cache: 'pnpm' - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - name: Download all artifacts uses: actions/download-artifact@v8 with: path: packages/cli/artifacts - name: Move artifacts run: pnpm artifacts - name: List packages run: ls -R ./npm shell: bash - name: Publish run: | npm publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: '' RELEASE_ID: ${{ github.event.client_payload.releaseId || inputs.releaseId }}