ci: disable ipv4 connectivity check #228
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-and-release | |
| defaults: | |
| run: | |
| shell: bash | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - master | |
| - develop | |
| workflow_dispatch: | |
| inputs: | |
| publish-binary: | |
| type: boolean | |
| default: false | |
| description: Force publish binary? | |
| required: true | |
| env: | |
| NODE_LIBCURL_GITHUB_TOKEN: ${{ secrets.NODE_LIBCURL_GITHUB_TOKEN }} | |
| concurrency: | |
| group: build-and-release-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| # all jobs here must have a matrix identical to the ones inside build-and-release.yaml | |
| jobs: | |
| config: | |
| uses: ./.github/workflows/reusable-config.yaml | |
| lint-and-tsc: | |
| uses: ./.github/workflows/reusable-lint-tsc.yaml | |
| build-and-release: | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| contents: write | |
| packages: write | |
| runs-on: ${{ matrix.os == 'alpine' && 'ubuntu-22.04' || matrix.os }} | |
| container: ${{ matrix.os == 'alpine' && format('node:{0}-alpine3.21', matrix.node) || '' }} | |
| needs: | |
| - config | |
| - lint-and-tsc | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| electron-version: | |
| - '' | |
| os: | |
| - macos-15 | |
| - ubuntu-22.04 | |
| - ubuntu-24.04-arm | |
| - alpine | |
| - windows-2025 | |
| libcurl-release: | |
| - ${{ needs.config.outputs.latest-libcurl-release }} | |
| node: | |
| - 25 | |
| - 24 | |
| - 22 | |
| include: | |
| - electron-version: 38.6.0 | |
| os: macos-15 | |
| node: 24 | |
| - electron-version: 38.6.0 | |
| os: ubuntu-22.04 | |
| node: 24 | |
| - electron-version: 38.6.0 | |
| os: windows-2025 | |
| node: 24 | |
| - electron-version: 39.1.1 | |
| os: macos-15 | |
| node: 24 | |
| - electron-version: 39.1.1 | |
| os: ubuntu-22.04 | |
| node: 24 | |
| - electron-version: 39.1.1 | |
| os: windows-2025 | |
| node: 24 | |
| env: | |
| LIBCURL_RELEASE: ${{ matrix.libcurl-release }} | |
| LATEST_LIBCURL_RELEASE: ${{ matrix.libcurl-release }} | |
| ELECTRON_VERSION: ${{ matrix.electron-version }} | |
| # this is false because we publish as a separate step | |
| PUBLISH_BINARY: false | |
| GIT_COMMIT: ${{ github.sha }} | |
| GIT_REF_NAME: ${{ github.ref_name }} | |
| steps: | |
| - name: Install initial deps (Alpine) | |
| if: matrix.os == 'alpine' | |
| shell: sh | |
| run: | | |
| apk add --no-cache git bash | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Install System Packages | |
| uses: ./.github/actions/install-system-packages | |
| - name: Should publish binary? | |
| id: should-publish | |
| run: | | |
| if [ "${{ inputs.publish-binary }}" = "true" ] || [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| echo "result=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "result=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Export Electron npm_config envs | |
| if: matrix.electron-version | |
| run: | | |
| echo "npm_config_runtime=electron" >> $GITHUB_ENV | |
| echo "npm_config_dist_url=https://electronjs.org/headers" >> $GITHUB_ENV | |
| echo "npm_config_target=${{ matrix.electron-version }}" >> $GITHUB_ENV | |
| # see https://github.com/nodejs/node/issues/40537 | |
| # - name: Enforce IPv4 Connectivity | |
| # if: matrix.os != 'alpine' | |
| # uses: ./.github/actions/force-ipv4 | |
| # PNPM / Node.js | |
| - name: Setup Node and PNPM | |
| uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| node-version: '${{ matrix.node }}' | |
| skip-node-setup: ${{ matrix.os == 'alpine' && 'true' || 'false' }} | |
| - name: Setup Libcurl Cache (Restore, Non-Windows) | |
| if: runner.os != 'Windows' | |
| id: libcurl-deps-cache | |
| uses: ./.github/actions/setup-libcurl-cache | |
| with: | |
| libcurl-release: ${{ matrix.libcurl-release }} | |
| node-version: ${{ matrix.node }} | |
| electron-version: ${{ matrix.electron-version }} | |
| electron-config-cache: ${{ needs.config.outputs.electron-config-cache }} | |
| mode: 'restore-only' | |
| - name: Setup tmate session | |
| uses: mxschmitt/action-tmate@v3 | |
| if: matrix.enable-debugging | |
| - name: 'Build and Package Binary (Non-Windows)' | |
| if: runner.os != 'Windows' | |
| run: ./scripts/ci/build.sh | |
| - name: 'Check if fully installed and built (Non-Windows)' | |
| id: built-and-installed | |
| if: runner.os != 'Windows' | |
| run: | | |
| if [[ -f built-and-installed.hidden.txt ]]; then | |
| echo "built-and-installed.hidden.txt exists" | |
| echo "status=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "built-and-installed.hidden.txt does not exist" | |
| echo "status=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Setup Libcurl Cache (Save, Non-Windows) | |
| if: runner.os != 'Windows' && steps.libcurl-deps-cache.outputs.cache-hit != 'true' && steps.built-and-installed.outputs.status == 'true' | |
| uses: ./.github/actions/setup-libcurl-cache | |
| with: | |
| libcurl-release: ${{ matrix.libcurl-release }} | |
| node-version: ${{ matrix.node }} | |
| electron-version: ${{ matrix.electron-version }} | |
| electron-config-cache: ${{ needs.config.outputs.electron-config-cache }} | |
| mode: 'save-only' | |
| - name: Setup vcpkg (Windows) | |
| if: runner.os == 'Windows' | |
| uses: ./.github/actions/setup-vcpkg-windows | |
| - name: 'Build and Package Binary (Windows)' | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: ./scripts/ci/windows/build.ps1 | |
| - name: Create attestations | |
| uses: actions/attest-build-provenance@v3 | |
| if: steps.should-publish.outputs.result == 'true' | |
| with: | |
| subject-path: 'build/**/node_libcurl-*.tar.gz' | |
| - name: 'Publish Binary [macos arm64]' | |
| if: runner.os == 'macOS' && steps.should-publish.outputs.result == 'true' | |
| env: | |
| npm_config_target_arch: arm64 | |
| run: | | |
| node scripts/module-packaging.js --publish "$(pnpm --silent pregyp reveal staged_tarball --silent)" | |
| - name: 'Publish Binary [macos x64]' | |
| if: runner.os == 'macOS' && steps.should-publish.outputs.result == 'true' | |
| env: | |
| npm_config_target_arch: x64 | |
| run: | | |
| node scripts/module-packaging.js --publish "$(pnpm --silent pregyp reveal staged_tarball --silent)" | |
| - name: 'Publish Binary [non macos]' | |
| if: runner.os != 'macOS' && steps.should-publish.outputs.result == 'true' | |
| run: | | |
| node scripts/module-packaging.js --publish "$(pnpm --silent pregyp reveal staged_tarball --silent)" | |
| - name: Upload Build Logs | |
| if: always() && runner.os != 'Windows' | |
| uses: ./.github/actions/upload-build-logs | |
| with: | |
| artifact-name: build-logs-${{ matrix.os }}-${{ matrix.libcurl-release }}-${{ matrix.electron-version && 'electron' || 'node' }}-${{ matrix.electron-version || matrix.node }} | |
| retention-days: '3' |