Skip to content

Commit 7edf299

Browse files
committed
Merge branch 'main' into 3.10
2 parents 70b88c5 + 5e37c10 commit 7edf299

File tree

3 files changed

+88
-69
lines changed

3 files changed

+88
-69
lines changed

.github/workflows/ci.yaml

+68-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ 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+
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 }}
833

934
env:
1035
FORCE_COLOR: "1"
@@ -19,8 +44,46 @@ concurrency:
1944
cancel-in-progress: true
2045

2146
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+
- uses: actions/[email protected]
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+
2284
build:
2385
runs-on: macOS-latest
86+
needs: [ config ]
2487
strategy:
2588
fail-fast: false
2689
matrix:
@@ -39,29 +102,23 @@ jobs:
39102
steps:
40103
- uses: actions/[email protected]
41104

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-
48105
- name: Set up Python
49106
uses: actions/[email protected]
50107
with:
51108
# Appending -dev ensures that we can always build the dev release.
52109
# 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
54111

55112
- name: Build ${{ matrix.target }}
56113
run: |
57114
# Do the build for the requested target.
58-
make ${{ matrix.target }}
115+
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
59116
60117
- name: Upload build artefacts
61118
uses: actions/[email protected]
62119
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
65122

66123
- uses: actions/[email protected]
67124
if: matrix.run-tests
@@ -84,4 +141,4 @@ jobs:
84141
timeout-minutes: 10
85142
working-directory: Python-support-testbed
86143
# 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\'

.github/workflows/release.yaml

+18-56
Original file line numberDiff line numberDiff line change
@@ -8,74 +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-
OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
60-
XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
61-
62-
echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
63-
echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
64-
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}
65-
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
66-
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
67-
68-
- name: Upload Build Artifact
69-
uses: actions/[email protected]
70-
with:
71-
name: dist-${{ matrix.target }}
72-
path: dist
73-
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 }}
7436

7537
make-release:
7638
name: Make Release
7739
runs-on: ubuntu-latest
78-
needs: build
40+
needs: [ config, ci ]
7941
steps:
8042
- name: Get build artifacts
8143
uses: actions/[email protected]
@@ -87,16 +49,16 @@ jobs:
8749
- name: Create Release
8850
uses: ncipollo/[email protected]
8951
with:
90-
name: ${{ needs.build.outputs.PYTHON_VER }}-${{ needs.build.outputs.BUILD_NUMBER }}
91-
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 }}
9254
draft: true
9355
body: |
94-
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 }}.
9557
9658
Includes:
97-
* Python ${{ needs.build.outputs.PYTHON_VERSION }}
98-
* BZip2 ${{ needs.build.outputs.BZIP2_VERSION }}
99-
* libFFI ${{ needs.build.outputs.LIBFFI_VERSION }}
100-
* OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }}
101-
* 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+
* OpenSSL ${{ needs.ci.outputs.OPENSSL_VERSION }}
63+
* XZ ${{ needs.ci.outputs.XZ_VERSION }}
10264
artifacts: "dist/*"

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@ config:
639639
@echo "PYTHON_VER=$(PYTHON_VER)"
640640
@echo "BUILD_NUMBER=$(BUILD_NUMBER)"
641641
@echo "BZIP2_VERSION=$(BZIP2_VERSION)"
642-
@echo "XZ_VERSION=$(XZ_VERSION)"
643-
@echo "OPENSSL_VERSION=$(OPENSSL_VERSION)"
644642
@echo "LIBFFI_VERSION=$(LIBFFI_VERSION)"
643+
@echo "OPENSSL_VERSION=$(OPENSSL_VERSION)"
644+
@echo "XZ_VERSION=$(XZ_VERSION)"
645645

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

0 commit comments

Comments
 (0)