1
1
on :
2
+ push :
3
+ paths-ignore :
4
+ - " .github/dependabot.yml"
5
+ - " .github/workflows/lint.yml"
6
+ - " .github/workflows/test.yml"
7
+ - " .pre-commit-config.yaml"
8
+ - " .ruff.toml"
9
+ - " README.md"
10
+ - " tests/**"
11
+ pull_request :
12
+ paths-ignore :
13
+ - " .github/dependabot.yml"
14
+ - " .github/workflows/lint.yml"
15
+ - " .github/workflows/test.yml"
16
+ - " .pre-commit-config.yaml"
17
+ - " .ruff.toml"
18
+ - " README.md"
19
+ - " tests/**"
2
20
workflow_dispatch :
3
21
inputs :
4
22
git_remote :
18
36
19
37
name : " Build Python source and docs artifacts"
20
38
39
+ # Set from inputs for workflow_dispatch, or set defaults to test push/PR events
40
+ env :
41
+ GIT_REMOTE : ${{ github.event.inputs.git_remote || 'python' }}
42
+ GIT_COMMIT : ${{ github.event.inputs.git_commit || 'f6650f9ad73359051f3e558c2431a109bc016664' }}
43
+ CPYTHON_RELEASE : ${{ github.event.inputs.cpython_release || '3.12.3' }}
44
+
21
45
jobs :
22
46
verify-input :
23
47
runs-on : ubuntu-22.04
48
+ outputs :
49
+ # Needed because env vars are not available in the build-docs check below
50
+ cpython_release : ${{ env.CPYTHON_RELEASE }}
24
51
steps :
25
52
- name : " Workflow run information"
26
53
run : |
27
- echo "git_remote: ${{ inputs.git_remote }} "
28
- echo "git_commit: ${{ inputs.git_commit }} "
29
- echo "cpython_release: ${{ inputs.cpython_release }} "
54
+ echo "git_remote: $GIT_REMOTE "
55
+ echo "git_commit: $GIT_COMMIT "
56
+ echo "cpython_release: $CPYTHON_RELEASE "
30
57
31
- - name : " Checkout ${{ inputs.git_remote }}/cpython"
58
+ - name : " Checkout ${{ env.GIT_REMOTE }}/cpython"
32
59
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
33
60
with :
34
- repository : " ${{ inputs.git_remote }}/cpython"
35
- ref : " v${{ inputs.cpython_release }}"
61
+ repository : " ${{ env.GIT_REMOTE }}/cpython"
62
+ ref : " v${{ env.CPYTHON_RELEASE }}"
36
63
path : " cpython"
37
64
38
65
- name : " Verify CPython commit matches tag"
39
66
run : |
40
- if [[ "${{ inputs.git_commit }} " != "$(cd cpython && git rev-parse HEAD)" ]]; then
41
- echo "expected git commit ('${{ inputs.git_commit }} ') didn't match tagged commit ('$(git rev-parse HEAD)')"
67
+ if [[ "$GIT_COMMIT " != "$(cd cpython && git rev-parse HEAD)" ]]; then
68
+ echo "expected git commit ('$GIT_COMMIT ') didn't match tagged commit ('$(git rev-parse HEAD)')"
42
69
exit 1
43
70
fi
44
71
@@ -50,11 +77,11 @@ jobs:
50
77
- name : " Checkout python/release-tools"
51
78
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
52
79
53
- - name : " Checkout ${{ inputs.git_remote }}/cpython"
80
+ - name : " Checkout ${{ env.GIT_REMOTE }}/cpython"
54
81
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
55
82
with :
56
- repository : " ${{ inputs.git_remote }}/cpython"
57
- ref : " v${{ inputs.cpython_release }}"
83
+ repository : " ${{ env.GIT_REMOTE }}/cpython"
84
+ ref : " v${{ env.CPYTHON_RELEASE }}"
58
85
path : " cpython"
59
86
60
87
- name : " Setup Python"
@@ -70,29 +97,28 @@ jobs:
70
97
- name : " Build Python release artifacts"
71
98
run : |
72
99
cd cpython
73
- python ../release.py --export ${{ inputs.cpython_release }} --skip-docs
100
+ python ../release.py --export "$CPYTHON_RELEASE" --skip-docs
74
101
75
102
- name : " Upload the source artifacts"
76
103
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
77
104
with :
78
105
name : source
79
106
path : |
80
- cpython/${{ inputs.cpython_release }}/src
107
+ cpython/${{ env.CPYTHON_RELEASE }}/src
81
108
82
109
build-docs :
83
110
runs-on : ubuntu-22.04
84
111
needs :
85
112
- verify-input
86
113
87
114
# Docs aren't built for alpha or beta releases.
88
- if : ${{ !(contains(inputs.cpython_release, 'a') || contains(inputs.cpython_release, 'b')) }}
89
-
115
+ if : (!(contains(needs.verify-input.outputs.cpython_release, 'a') || contains(needs.verify-input.outputs.cpython_release, 'b')))
90
116
steps :
91
- - name : " Checkout ${{ inputs.git_remote }}/cpython"
117
+ - name : " Checkout ${{ env.GIT_REMOTE }}/cpython"
92
118
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
93
119
with :
94
- repository : " ${{ inputs.git_remote }}/cpython"
95
- ref : " v${{ inputs.cpython_release }}"
120
+ repository : " ${{ env.GIT_REMOTE }}/cpython"
121
+ ref : " v${{ env.CPYTHON_RELEASE }}"
96
122
97
123
- name : " Setup Python"
98
124
uses : actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
@@ -135,10 +161,10 @@ jobs:
135
161
- name : " Test Python source tarballs"
136
162
run : |
137
163
mkdir -p ./tmp/installation/
138
- cp Python-${{ inputs.cpython_release }}. tgz ./tmp/
164
+ cp " Python-$CPYTHON_RELEASE. tgz" ./tmp/
139
165
cd tmp/
140
- tar xvf Python-${{ inputs.cpython_release }}. tgz
141
- cd Python-${{ inputs.cpython_release }}
166
+ tar xvf " Python-$CPYTHON_RELEASE. tgz"
167
+ cd " Python-$CPYTHON_RELEASE"
142
168
143
169
./configure "--prefix=$(realpath '../installation/')"
144
170
make -j
0 commit comments