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
+ OPENSSL_VERSION :
28
+ description : " The OpenSSL version used for the build."
29
+ value : ${{ jobs.config.outputs.OPENSSL_VERSION }}
30
+ XZ_VERSION :
31
+ description : " The XZ version used for the build."
32
+ value : ${{ jobs.config.outputs.XZ_VERSION }}
8
33
9
34
env :
10
35
FORCE_COLOR : " 1"
@@ -19,8 +44,46 @@ concurrency:
19
44
cancel-in-progress : true
20
45
21
46
jobs :
47
+ config :
48
+ runs-on : macOS-latest
49
+ outputs :
50
+ PYTHON_VER : ${{ steps.extract.outputs.PYTHON_VER }}
51
+ PYTHON_VERSION : ${{ steps.extract.outputs.PYTHON_VERSION }}
52
+ BUILD_NUMBER : ${{ steps.extract.outputs.BUILD_NUMBER }}
53
+ BZIP2_VERSION : ${{ steps.extract.outputs.BZIP2_VERSION }}
54
+ LIBFFI_VERSION : ${{ steps.extract.outputs.LIBFFI_VERSION }}
55
+ OPENSSL_VERSION : ${{ steps.extract.outputs.OPENSSL_VERSION }}
56
+ XZ_VERSION : ${{ steps.extract.outputs.XZ_VERSION }}
57
+
58
+ steps :
59
+
60
+
61
+ - name : Extract config variables
62
+ id : extract
63
+ run : |
64
+ PYTHON_VER=$(make config | grep "PYTHON_VER=" | cut -d "=" -f 2)
65
+ PYTHON_VERSION=$(make config | grep "PYTHON_VERSION=" | cut -d "=" -f 2)
66
+ BZIP2_VERSION=$(make config | grep "BZIP2_VERSION=" | cut -d "=" -f 2)
67
+ LIBFFI_VERSION=$(make config | grep "LIBFFI_VERSION=" | cut -d "=" -f 2)
68
+ OPENSSL_VERSION=$(make config | grep "OPENSSL_VERSION=" | cut -d "=" -f 2)
69
+ XZ_VERSION=$(make config | grep "XZ_VERSION=" | cut -d "=" -f 2)
70
+ if [ -z "${{ inputs.build-number }}" ]; then
71
+ BUILD_NUMBER=custom
72
+ else
73
+ BUILD_NUMBER=${{ inputs.build-number }}
74
+ fi
75
+
76
+ echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}
77
+ echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
78
+ echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a ${GITHUB_OUTPUT}
79
+ echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
80
+ echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}
81
+ echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
82
+ echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
83
+
22
84
build :
23
85
runs-on : macOS-latest
86
+ needs : [ config ]
24
87
strategy :
25
88
fail-fast : false
26
89
matrix :
@@ -39,29 +102,23 @@ jobs:
39
102
steps :
40
103
41
104
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
105
- name : Set up Python
49
106
50
107
with :
51
108
# Appending -dev ensures that we can always build the dev release.
52
109
# It's a no-op for versions that have been published.
53
- python-version : ${{ steps .config-vars .outputs.PYTHON_VER }}-dev
110
+ python-version : ${{ needs .config.outputs.PYTHON_VER }}-dev
54
111
55
112
- name : Build ${{ matrix.target }}
56
113
run : |
57
114
# Do the build for the requested target.
58
- make ${{ matrix.target }}
115
+ make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
59
116
60
117
- name : Upload build artefacts
61
118
62
119
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
120
+ name : Python-${{ needs .config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }} .tar.gz
121
+ path : dist/Python-${{ needs .config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }} .tar.gz
65
122
66
123
67
124
if : matrix.run-tests
84
141
timeout-minutes : 10
85
142
working-directory : Python-support-testbed
86
143
# 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\'
144
+ 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