Skip to content

Commit 1173047

Browse files
committed
Merge branch 'main' into 3.11
2 parents d77dd2a + 5e37c10 commit 1173047

File tree

3 files changed

+96
-72
lines changed

3 files changed

+96
-72
lines changed

.github/workflows/ci.yaml

+74-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ on:
55
branches:
66
- main
77
- 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 }}
836

937
env:
1038
FORCE_COLOR: "1"
@@ -19,8 +47,49 @@ concurrency:
1947
cancel-in-progress: true
2048

2149
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+
- uses: actions/[email protected]
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+
2290
build:
2391
runs-on: macOS-latest
92+
needs: [ config ]
2493
strategy:
2594
fail-fast: false
2695
matrix:
@@ -39,29 +108,23 @@ jobs:
39108
steps:
40109
- uses: actions/[email protected]
41110

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-
48111
- name: Set up Python
49112
uses: actions/[email protected]
50113
with:
51114
# Appending -dev ensures that we can always build the dev release.
52115
# 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
54117

55118
- name: Build ${{ matrix.target }}
56119
run: |
57120
# Do the build for the requested target.
58-
make ${{ matrix.target }}
121+
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
59122
60123
- name: Upload build artefacts
61124
uses: actions/[email protected]
62125
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
65128

66129
- uses: actions/[email protected]
67130
if: matrix.run-tests
@@ -84,4 +147,4 @@ jobs:
84147
timeout-minutes: 10
85148
working-directory: Python-support-testbed
86149
# 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\'

.github/workflows/release.yaml

+19-59
Original file line numberDiff line numberDiff line change
@@ -8,76 +8,36 @@ on:
88
- '*-b*'
99

1010
jobs:
11-
build:
12-
name: Build
11+
config:
12+
name: Build vars
1313
runs-on: macOS-latest
1414
outputs:
1515
TAG: ${{ steps.build-vars.outputs.TAG }}
16-
PYTHON_VER: ${{ steps.build-vars.outputs.PYTHON_VER }}
1716
BUILD_NUMBER: ${{ steps.build-vars.outputs.BUILD_NUMBER }}
18-
PYTHON_VERSION: ${{ steps.version-details.outputs.PYTHON_VERSION }}
19-
BZIP2_VERSION: ${{ steps.version-details.outputs.BZIP2_VERSION }}
20-
XZ_VERSION: ${{ steps.version-details.outputs.XZ_VERSION }}
21-
LIBFFI_VERSION: ${{ steps.version-details.outputs.LIBFFI_VERSION }}
22-
OPENSSL_VERSION: ${{ steps.version-details.outputs.OPENSSL_VERSION }}
23-
strategy:
24-
matrix:
25-
target: [ "macOS", "iOS", "tvOS", "watchOS" ]
26-
steps:
27-
- name: Checkout
28-
uses: actions/[email protected]
2917

18+
steps:
3019
- name: Set Build Variables
3120
id: build-vars
3221
env:
3322
TAG_NAME: ${{ github.ref }}
3423
run: |
3524
export TAG=$(basename $TAG_NAME)
36-
export PYTHON_VER="${TAG%-*}"
3725
export BUILD_NUMBER="${TAG#*-}"
3826
3927
echo "TAG=${TAG}" | tee -a ${GITHUB_OUTPUT}
40-
echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}
4128
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a ${GITHUB_OUTPUT}
4229
43-
- name: Set up Python
44-
uses: actions/[email protected]
45-
with:
46-
python-version: "${{ steps.build-vars.outputs.PYTHON_VER }}-dev"
47-
48-
- name: Build ${{ matrix.target }}
49-
run: |
50-
# Do the build for the requested target.
51-
make ${{ matrix.target }} BUILD_NUMBER=${{ steps.build-vars.outputs.BUILD_NUMBER }}
52-
53-
- name: Extract Version Details
54-
id: version-details
55-
run: |
56-
PYTHON_VERSION=$(grep "Python version:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 3)
57-
BZIP2_VERSION=$(grep "BZip2:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
58-
LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
59-
MPDECIMAL_VERSION=$(grep "mpdecimal:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
60-
OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
61-
XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
62-
63-
echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
64-
echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
65-
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}
66-
echo "MPDECIMAL_VERSION=${MPDECIMAL_VERSION}" | tee -a ${GITHUB_OUTPUT}
67-
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
68-
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
69-
70-
- name: Upload Build Artifact
71-
uses: actions/[email protected]
72-
with:
73-
name: dist-${{ matrix.target }}
74-
path: dist
75-
if-no-files-found: error
30+
ci:
31+
name: CI
32+
needs: [ config ]
33+
uses: ./.github/workflows/ci.yaml
34+
with:
35+
build-number: ${{ needs.config.outputs.BUILD_NUMBER }}
7636

7737
make-release:
7838
name: Make Release
7939
runs-on: ubuntu-latest
80-
needs: build
40+
needs: [ config, ci ]
8141
steps:
8242
- name: Get build artifacts
8343
uses: actions/[email protected]
@@ -89,17 +49,17 @@ jobs:
8949
- name: Create Release
9050
uses: ncipollo/[email protected]
9151
with:
92-
name: ${{ needs.build.outputs.PYTHON_VER }}-${{ needs.build.outputs.BUILD_NUMBER }}
93-
tag: ${{ needs.build.outputs.PYTHON_VER }}-${{ needs.build.outputs.BUILD_NUMBER }}
52+
name: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}
53+
tag: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}
9454
draft: true
9555
body: |
96-
Build ${{ needs.build.outputs.BUILD_NUMBER }} of the BeeWare support package for Python ${{ needs.build.outputs.PYTHON_VER }}.
56+
Build ${{ needs.config.outputs.BUILD_NUMBER }} of the BeeWare support package for Python ${{ needs.ci.outputs.PYTHON_VER }}.
9757
9858
Includes:
99-
* Python ${{ needs.build.outputs.PYTHON_VERSION }}
100-
* BZip2 ${{ needs.build.outputs.BZIP2_VERSION }}
101-
* libFFI ${{ needs.build.outputs.LIBFFI_VERSION }}
102-
* mpdecimal ${{ needs.build.outputs.MPDECIMAL_VERSION }}
103-
* OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }}
104-
* XZ ${{ needs.build.outputs.XZ_VERSION }}
59+
* Python ${{ needs.ci.outputs.PYTHON_VERSION }}
60+
* BZip2 ${{ needs.ci.outputs.BZIP2_VERSION }}
61+
* libFFI ${{ needs.ci.outputs.LIBFFI_VERSION }}
62+
* mpdecimal ${{ needs.ci.outputs.MPDECIMAL_VERSION }}
63+
* OpenSSL ${{ needs.ci.outputs.OPENSSL_VERSION }}
64+
* XZ ${{ needs.ci.outputs.XZ_VERSION }}
10565
artifacts: "dist/*"

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,10 @@ config:
675675
@echo "PYTHON_VER=$(PYTHON_VER)"
676676
@echo "BUILD_NUMBER=$(BUILD_NUMBER)"
677677
@echo "BZIP2_VERSION=$(BZIP2_VERSION)"
678-
@echo "XZ_VERSION=$(XZ_VERSION)"
679-
@echo "OPENSSL_VERSION=$(OPENSSL_VERSION)"
680678
@echo "LIBFFI_VERSION=$(LIBFFI_VERSION)"
679+
@echo "MPDECIMAL_VERSION=$(MPDECIMAL_VERSION)"
680+
@echo "OPENSSL_VERSION=$(OPENSSL_VERSION)"
681+
@echo "XZ_VERSION=$(XZ_VERSION)"
681682

682683
# Expand cross-platform build and clean targets for each output product
683684
clean: $(foreach os,$(OS_LIST),clean-$(os))

0 commit comments

Comments
 (0)