Merge branch 'main' into dependabot/pip/pip-80c3077983 #41
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
on: | |
push: | |
paths-ignore: | |
- ".github/dependabot.yml" | |
- ".github/workflows/lint.yml" | |
- ".github/workflows/test.yml" | |
- ".pre-commit-config.yaml" | |
- ".ruff.toml" | |
- "README.md" | |
- "tests/**" | |
pull_request: | |
paths-ignore: | |
- ".github/dependabot.yml" | |
- ".github/workflows/lint.yml" | |
- ".github/workflows/test.yml" | |
- ".pre-commit-config.yaml" | |
- ".ruff.toml" | |
- "README.md" | |
- "tests/**" | |
workflow_dispatch: | |
inputs: | |
git_remote: | |
type: choice | |
description: "Git remote to checkout" | |
options: | |
- python | |
- hugovk | |
- Yhg1s | |
- pablogsal | |
- ambv | |
git_commit: | |
type: string | |
description: "Git commit to target for the release. Must use the full commit SHA, not the short ID" | |
cpython_release: | |
type: string | |
description: "CPython release number (ie '3.11.5', note without the 'v' prefix)" | |
name: "Build release artifacts" | |
permissions: {} | |
# Set from inputs for workflow_dispatch, or set defaults to test push/PR events | |
env: | |
GIT_REMOTE: ${{ github.event.inputs.git_remote || 'python' }} | |
GIT_COMMIT: ${{ github.event.inputs.git_commit || '31967d8de3d27889dd1819b8dccc2bdc17c030c1' }} | |
CPYTHON_RELEASE: ${{ github.event.inputs.cpython_release || '3.14.0rc2' }} | |
jobs: | |
verify-input: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 5 | |
outputs: | |
build-docs: ${{ steps.select-jobs.outputs.docs }} | |
build-android: ${{ steps.select-jobs.outputs.android }} | |
steps: | |
- name: "Workflow run information" | |
run: | | |
echo "git_remote: $GIT_REMOTE" | |
echo "git_commit: $GIT_COMMIT" | |
echo "cpython_release: $CPYTHON_RELEASE" | |
- name: "Checkout python/release-tools" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: "Checkout ${{ env.GIT_REMOTE }}/cpython" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
repository: "${{ env.GIT_REMOTE }}/cpython" | |
ref: "v${{ env.CPYTHON_RELEASE }}" | |
path: "cpython" | |
- name: "Verify CPython commit matches tag" | |
run: | | |
if [[ "$GIT_COMMIT" != "$(cd cpython && git rev-parse HEAD)" ]]; then | |
echo "expected git commit ('$GIT_COMMIT') didn't match tagged commit ('$(git rev-parse HEAD)')" | |
exit 1 | |
fi | |
- name: "Setup Python" | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.12 | |
- name: "Select jobs" | |
id: select-jobs | |
run: | | |
./select_jobs.py "$CPYTHON_RELEASE" | tee -a "$GITHUB_OUTPUT" | |
build-source: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 15 | |
needs: | |
- verify-input | |
steps: | |
- name: "Checkout python/release-tools" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: "Checkout ${{ env.GIT_REMOTE }}/cpython" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
repository: "${{ env.GIT_REMOTE }}/cpython" | |
ref: "v${{ env.CPYTHON_RELEASE }}" | |
path: "cpython" | |
- name: "Setup Python" | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.12 | |
- name: "Install source dependencies" | |
run: | | |
python -m pip install --no-deps \ | |
-r requirements.txt | |
- name: "Build Python release artifacts" | |
run: | | |
cd cpython | |
python ../release.py --export "$CPYTHON_RELEASE" --skip-docs | |
- name: "Upload the source artifacts" | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: source | |
path: | | |
cpython/${{ env.CPYTHON_RELEASE }}/src | |
build-docs: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 45 | |
needs: | |
- verify-input | |
if: fromJSON(needs.verify-input.outputs.build-docs) | |
steps: | |
- name: "Checkout ${{ env.GIT_REMOTE }}/cpython" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
repository: "${{ env.GIT_REMOTE }}/cpython" | |
ref: "v${{ env.CPYTHON_RELEASE }}" | |
- name: "Setup Python" | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.12 | |
- name: "Install docs dependencies" | |
run: | | |
python -m pip install -r Doc/requirements.txt | |
sudo apt-get update | |
sudo apt-get install --yes --no-install-recommends \ | |
fonts-freefont-otf \ | |
latexmk \ | |
texinfo \ | |
texlive-fonts-extra \ | |
texlive-fonts-recommended \ | |
texlive-latex-base \ | |
texlive-latex-extra \ | |
texlive-latex-recommended \ | |
texlive-xetex \ | |
xindy | |
- name: "Build docs" | |
run: | | |
cd Doc | |
SPHINXOPTS="-j10" make dist | |
- name: "Upload the docs artifacts" | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: docs | |
path: | | |
Doc/dist/ | |
test-source: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 60 | |
needs: | |
- build-source | |
steps: | |
- name: "Download the source artifacts" | |
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
with: | |
name: source | |
- name: "Test Python source tarballs" | |
run: | | |
mkdir -p ./tmp/installation/ | |
cp "Python-$CPYTHON_RELEASE.tgz" ./tmp/ | |
cd tmp/ | |
tar xvf "Python-$CPYTHON_RELEASE.tgz" | |
cd "Python-$CPYTHON_RELEASE" | |
./configure "--prefix=$(realpath '../installation/')" | |
make -j | |
make install -j | |
cd ../installation | |
./bin/python3 -m test -uall | |
build-android: | |
name: build-android (${{ matrix.arch }}) | |
needs: | |
- verify-input | |
if: fromJSON(needs.verify-input.outputs.build-android) | |
strategy: | |
matrix: | |
include: | |
- arch: aarch64 | |
runs-on: macos-15 | |
- arch: x86_64 | |
runs-on: ubuntu-24.04 | |
runs-on: ${{ matrix.runs-on }} | |
timeout-minutes: 60 | |
env: | |
triplet: ${{ matrix.arch }}-linux-android | |
steps: | |
- name: "Checkout ${{ env.GIT_REMOTE }}/cpython" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
repository: "${{ env.GIT_REMOTE }}/cpython" | |
ref: "v${{ env.CPYTHON_RELEASE }}" | |
- name: Build and test | |
run: ./Android/android.py ci "$triplet" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.triplet }} | |
path: cross-build/${{ env.triplet }}/dist/* | |
if-no-files-found: error |