5
5
branches :
6
6
- main
7
7
- 3.*
8
+ workflow_call :
9
+ inputs :
10
+ build-number :
11
+ description : " The build number to add to the built package"
12
+ default : " custom"
13
+ type : " string"
14
+ outputs :
15
+ PYTHON_VER :
16
+ description : " The Python major.minor version."
17
+ value : ${{ jobs.config.outputs.PYTHON_VER }}
18
+ PYTHON_VERSION :
19
+ description : " The full Python version."
20
+ value : ${{ jobs.config.outputs.PYTHON_VERSION }}
21
+ BZIP2_VERSION :
22
+ description : " The BZip2 version used for the build."
23
+ value : ${{ jobs.config.outputs.BZIP2_VERSION }}
24
+ LIBFFI_VERSION :
25
+ description : " The libFFI version used for the build."
26
+ value : ${{ jobs.config.outputs.LIBFFI_VERSION }}
27
+ MPDECIMAL_VERSION :
28
+ description : " The mpdecimal version used for the build."
29
+ value : ${{ jobs.config.outputs.MPDECIMAL_VERSION }}
30
+ OPENSSL_VERSION :
31
+ description : " The OpenSSL version used for the build."
32
+ value : ${{ jobs.config.outputs.OPENSSL_VERSION }}
33
+ XZ_VERSION :
34
+ description : " The XZ version used for the build."
35
+ value : ${{ jobs.config.outputs.XZ_VERSION }}
8
36
9
37
env :
10
38
FORCE_COLOR : " 1"
@@ -19,8 +47,49 @@ concurrency:
19
47
cancel-in-progress : true
20
48
21
49
jobs :
50
+ config :
51
+ runs-on : macOS-latest
52
+ outputs :
53
+ PYTHON_VER : ${{ steps.extract.outputs.PYTHON_VER }}
54
+ PYTHON_VERSION : ${{ steps.extract.outputs.PYTHON_VERSION }}
55
+ BUILD_NUMBER : ${{ steps.extract.outputs.BUILD_NUMBER }}
56
+ BZIP2_VERSION : ${{ steps.extract.outputs.BZIP2_VERSION }}
57
+ LIBFFI_VERSION : ${{ steps.extract.outputs.LIBFFI_VERSION }}
58
+ MPDECIMAL_VERSION : ${{ steps.extract.outputs.MPDECIMAL_VERSION }}
59
+ OPENSSL_VERSION : ${{ steps.extract.outputs.OPENSSL_VERSION }}
60
+ XZ_VERSION : ${{ steps.extract.outputs.XZ_VERSION }}
61
+
62
+ steps :
63
+
64
+
65
+ - name : Extract config variables
66
+ id : extract
67
+ run : |
68
+ PYTHON_VER=$(make config | grep "PYTHON_VER=" | cut -d "=" -f 2)
69
+ PYTHON_VERSION=$(make config | grep "PYTHON_VERSION=" | cut -d "=" -f 2)
70
+ BZIP2_VERSION=$(make config | grep "BZIP2_VERSION=" | cut -d "=" -f 2)
71
+ LIBFFI_VERSION=$(make config | grep "LIBFFI_VERSION=" | cut -d "=" -f 2)
72
+ MPDECIMAL_VERSION=$(make config | grep "MPDECIMAL_VERSION=" | cut -d "=" -f 2)
73
+ OPENSSL_VERSION=$(make config | grep "OPENSSL_VERSION=" | cut -d "=" -f 2)
74
+ XZ_VERSION=$(make config | grep "XZ_VERSION=" | cut -d "=" -f 2)
75
+ if [ -z "${{ inputs.build-number }}" ]; then
76
+ BUILD_NUMBER=custom
77
+ else
78
+ BUILD_NUMBER=${{ inputs.build-number }}
79
+ fi
80
+
81
+ echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}
82
+ echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
83
+ echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a ${GITHUB_OUTPUT}
84
+ echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
85
+ echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}
86
+ echo "MPDECIMAL_VERSION=${MPDECIMAL_VERSION}" | tee -a ${GITHUB_OUTPUT}
87
+ echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
88
+ echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
89
+
22
90
build :
23
91
runs-on : macOS-latest
92
+ needs : [ config ]
24
93
strategy :
25
94
fail-fast : false
26
95
matrix :
@@ -39,29 +108,23 @@ jobs:
39
108
steps :
40
109
41
110
42
- - name : Extract config variables
43
- id : config-vars
44
- run : |
45
- PYTHON_VER=$(make config | grep "PYTHON_VER=" | cut -d "=" -f 2)
46
- echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}
47
-
48
111
- name : Set up Python
49
112
50
113
with :
51
114
# Appending -dev ensures that we can always build the dev release.
52
115
# It's a no-op for versions that have been published.
53
- python-version : ${{ steps .config-vars .outputs.PYTHON_VER }}-dev
116
+ python-version : ${{ needs .config.outputs.PYTHON_VER }}-dev
54
117
55
118
- name : Build ${{ matrix.target }}
56
119
run : |
57
120
# Do the build for the requested target.
58
- make ${{ matrix.target }}
121
+ make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
59
122
60
123
- name : Upload build artefacts
61
124
62
125
with :
63
- name : Python-${{ steps .config-vars .outputs.PYTHON_VER }}-${{ matrix.target }}-support.custom .tar.gz
64
- path : dist/Python-${{ steps .config-vars .outputs.PYTHON_VER }}-${{ matrix.target }}-support.custom .tar.gz
126
+ name : Python-${{ needs .config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }} .tar.gz
127
+ path : dist/Python-${{ needs .config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }} .tar.gz
65
128
66
129
67
130
if : matrix.run-tests
84
147
timeout-minutes : 10
85
148
working-directory : Python-support-testbed
86
149
# TODO - remove the template_branch option.
87
- run : briefcase run ${{ matrix.target }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ steps .config-vars .outputs.PYTHON_VER }}-${{ matrix.target }}-support.custom .tar.gz\' -C template_branch=\'framework-lib\'
150
+ run : briefcase run ${{ matrix.target }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs .config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }} .tar.gz\' -C template_branch=\'framework-lib\'
0 commit comments