/
githubmirror
/
hyper
Обзор
Документация
Войти
/
githubmirror
/
hyper
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
.github/workflows/nodejs.yml
201 строка
7 KB
Steven
chore: switch package management to pnpm (#8184)
21 май 2026, 20:28
Не верифицирован
21 май 2026, 20:28
da0c401
Код
Авторство
О чём код?
name: Node CI on: push: branches: - master - canary pull_request: defaults: run: shell: bash env: NODE_VERSION: 18.x PNPM_VERSION: 10.33.0 jobs: build: runs-on: ${{matrix.os}} strategy: matrix: os: - macos-latest - ubuntu-latest - windows-latest fail-fast: false steps: - name: Checkout uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} - name: Enable pnpm ${{ env.PNPM_VERSION }} run: | corepack enable pnpm corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate - name: Fix node-gyp and Python run: python3 -m pip install packaging setuptools - name: Get pnpm store directory path id: pnpm-store-dir-path run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - uses: actions/cache/restore@v4 with: path: ${{ steps.pnpm-store-dir-path.outputs.dir }} key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml', 'app/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm- - name: Install run: pnpm install --frozen-lockfile env: npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }} - name: Install libarchive-tools if: runner.os == 'Linux' run: | sudo apt update sudo apt install libarchive-tools - name: Lint and Run Unit Tests run: pnpm run test - name: Getting Build Icon if: github.ref == 'refs/heads/canary' || github.base_ref == 'canary' run: | cp build/canary.ico build/icon.ico cp build/canary.icns build/icon.icns - name: Build run: | if [ -z "$CSC_LINK" ] ; then unset CSC_LINK ; fi if [ -z "$CSC_KEY_PASSWORD" ] ; then unset CSC_KEY_PASSWORD ; fi if [ -z "$WIN_CSC_LINK" ] ; then unset WIN_CSC_LINK ; fi if [ -z "$WIN_CSC_KEY_PASSWORD" ] ; then unset WIN_CSC_KEY_PASSWORD ; fi if [ -z "$APPLE_ID" ] ; then unset APPLE_ID ; fi if [ -z "$APPLE_APP_SPECIFIC_PASSWORD" ] ; then unset APPLE_APP_SPECIFIC_PASSWORD ; fi pnpm run dist env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} CSC_LINK: ${{ secrets.MAC_CERT_P12_BASE64 }} CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_P12_PASSWORD }} WIN_CSC_LINK: ${{ secrets.WIN_CERT_P12_BASE64 }} WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_P12_PASSWORD }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }} - name: Archive Build Artifacts uses: LabhanshAgrawal/upload-artifact@v3 with: path: | dist/*.dmg dist/*.snap dist/*.AppImage dist/*.deb dist/*.rpm dist/*.pacman dist/*.exe - name: Run E2E Tests if: runner.os != 'Linux' run: pnpm run test:e2e - name: Run E2E Tests on Linux if: runner.os == 'Linux' uses: GabrielBB/xvfb-action@v1.6 with: run: pnpm run test:e2e env: SHELL: /bin/bash - name: Archive E2E test screenshot uses: actions/upload-artifact@v3 with: name: e2e path: dist/tmp/*.png - name: Save the pr number in an artifact if: github.event_name == 'pull_request' env: PR_NUM: ${{ github.event.number }} run: echo $PR_NUM > pr_num.txt - name: Upload the pr num uses: actions/upload-artifact@v3 if: github.event_name == 'pull_request' with: name: pr_num path: ./pr_num.txt - uses: actions/cache/save@v4 if: github.event_name == 'push' with: path: ${{ steps.pnpm-store-dir-path.outputs.dir }} key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml', 'app/pnpm-lock.yaml') }} build-linux-arm: runs-on: ubuntu-latest strategy: matrix: include: - name: armv7l cpu: cortex-a8 image: raspios_lite:latest - name: arm64 cpu: cortex-a53 image: raspios_lite_arm64:latest fail-fast: false steps: - name: Checkout uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} - name: Enable pnpm ${{ env.PNPM_VERSION }} run: | corepack enable pnpm corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate - name: Fix node-gyp and Python run: python3 -m pip install packaging setuptools - name: Get pnpm store directory path id: pnpm-store-dir-path run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - uses: actions/cache/restore@v4 with: path: ${{ steps.pnpm-store-dir-path.outputs.dir }} key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml', 'app/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm- - name: Install run: | pnpm install --frozen-lockfile sudo apt update sudo apt install libarchive-tools - name: Compile run: pnpm run build - name: rebuild node-pty uses: pguyot/arm-runner-action@v2.5.2 with: image_additional_mb: 2000 base_image: ${{ matrix.image }} cpu: ${{ matrix.cpu }} shell: bash copy_artifact_path: target/node_modules/node-pty copy_artifact_dest: target/node_modules commands: | wget https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-${{ matrix.name }}.tar.xz tar -xJf node-v18.16.0-linux-${{ matrix.name }}.tar.xz sudo cp node-v18.16.0-linux-${{ matrix.name }}/* /usr/local/ -R corepack enable pnpm corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate pnpm run rebuild-node-pty - name: chown node-pty run: | sudo chown -R $USER:$USER target/node_modules/node-pty - name: Prepare v8 snapshot if: matrix.name == 'armv7l' run: | sudo dpkg --add-architecture i386 sudo apt update sudo apt install -y libglib2.0-0:i386 libexpat1:i386 libgcc-s1:i386 npm_config_arch=armv7l pnpm run v8-snapshot:arch - name: Build run: pnpm exec electron-builder -l deb rpm AppImage pacman --${{ matrix.name }} -c electron-builder-linux-ci.json env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Archive Build Artifacts uses: LabhanshAgrawal/upload-artifact@v3 with: path: | dist/*.snap dist/*.AppImage dist/*.deb dist/*.rpm dist/*.pacman