Bump to 3.14.2 #3651
Workflow file for this run
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: windows | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| FORCE_COLOR: 1 | |
| permissions: {} | |
| jobs: | |
| crate-build: | |
| needs: | |
| - generate-matrix | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: ${{ fromJson(needs.generate-matrix.outputs.crate-build-matrix) }} | |
| fail-fast: false | |
| name: crate / ${{ matrix.arch }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Emit rustc version | |
| run: | | |
| rustc --version > .rustc-version | |
| - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: | | |
| C:/Rust/.cargo/registry | |
| C:/Rust/.cargo/git | |
| target | |
| key: ${{ runner.os }}-pythonbuild-${{ hashFiles('Cargo.lock', '.rustc-version') }} | |
| - name: Build | |
| run: | | |
| cargo build --release | |
| - name: Upload executable | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: ${{ matrix.crate_artifact_name }} | |
| path: target/release/pythonbuild.exe | |
| generate-matrix: | |
| name: Generate build matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| crate-build-matrix: ${{ steps.set-matrix.outputs.crate-build-matrix }} | |
| any_builds: ${{ steps.set-matrix.outputs.any_builds }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 | |
| with: | |
| enable-cache: false | |
| - name: Get pull request labels | |
| id: get-labels | |
| env: | |
| PULL_REQUEST_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} | |
| run: | | |
| # Convert GitHub labels array to comma-separated string | |
| LABELS=$(echo "${PULL_REQUEST_LABELS}" | jq -r 'join(",")') | |
| echo "labels=$LABELS" >> $GITHUB_OUTPUT | |
| - name: Check if the `pythonbuild` crate changed | |
| id: check-pythonbuild | |
| env: | |
| BASE_REF: ${{ github.event.pull_request.base.ref || 'main' }} | |
| run: | | |
| merge_base=$(git merge-base HEAD "origin/${BASE_REF}") | |
| if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate build matrix | |
| id: set-matrix | |
| run: | | |
| uv run ci-matrix.py --platform windows --labels "${STEPS_GET_LABELS_OUTPUTS_LABELS}" ${{ (steps.check-pythonbuild.outputs.changed == 'true' || github.ref == 'refs/heads/main') && '--force-crate-build' || '' }} > matrix.json | |
| # Extract python-build matrix | |
| echo "matrix=$(jq -c '."python-build"' matrix.json)" >> $GITHUB_OUTPUT | |
| echo "crate-build-matrix=$(jq -c '."crate-build"' matrix.json)" >> $GITHUB_OUTPUT | |
| # Display the matrix for debugging too | |
| cat matrix.json | jq | |
| if jq -e '."python-build".include | length > 0' matrix.json > /dev/null; then | |
| # Build matrix has entries | |
| echo "any_builds=true" >> $GITHUB_OUTPUT | |
| else | |
| # Build matrix is empty | |
| echo "any_builds=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| STEPS_GET_LABELS_OUTPUTS_LABELS: ${{ steps.get-labels.outputs.labels }} | |
| build: | |
| timeout-minutes: 90 | |
| needs: | |
| - generate-matrix | |
| - crate-build | |
| # Permissions used for actions/attest-build-provenance | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
| fail-fast: false | |
| name: ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install Cygwin Environment | |
| uses: cygwin/cygwin-install-action@f2009323764960f80959895c7bc3bb30210afe4d # v6 | |
| with: | |
| packages: autoconf automake libtool | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 | |
| with: | |
| enable-cache: false | |
| - name: Download pythonbuild Executable | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: ${{ matrix.crate_artifact_name }} | |
| # We need to do this before we activate the VC++ environment or else binary packages | |
| # don't get compiled properly. | |
| - name: Bootstrap Python environment | |
| run: | | |
| uv run build-uv.py --help | |
| - name: Build | |
| if: ${{ ! matrix.dry-run }} | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\%MATRIX_VCVARS%" | |
| uv run build-uv.py --python cpython-%MATRIX_PYTHON% --sh c:\cygwin\bin\sh.exe --options %MATRIX_BUILD_OPTIONS% | |
| env: | |
| MATRIX_VCVARS: ${{ matrix.vcvars }} | |
| MATRIX_PYTHON: ${{ matrix.python }} | |
| MATRIX_BUILD_OPTIONS: ${{ matrix.build_options }} | |
| - name: Generate attestations | |
| uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| with: | |
| subject-path: dist/* | |
| - name: Upload Distributions | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: cpython-${{ matrix.python }}-${{ matrix.vcvars }}-${{ matrix.build_options }} | |
| path: dist/* | |
| - name: Validate Distribution | |
| if: ${{ ! matrix.dry-run }} | |
| run: | | |
| $Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative | |
| .\pythonbuild.exe validate-distribution --run $Dists |