Skip to content

Commit 80a86b4

Browse files
freakboy3742hugovk
andauthored
Add iOS XCframework build to release artefacts. (#365)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent dfb81dc commit 80a86b4

File tree

6 files changed

+68
-16
lines changed

6 files changed

+68
-16
lines changed

.github/workflows/build-release.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ permissions: {}
4343
# Set from inputs for workflow_dispatch, or set defaults to test push/PR events
4444
env:
4545
GIT_REMOTE: ${{ github.event.inputs.git_remote || 'python' }}
46-
GIT_COMMIT: ${{ github.event.inputs.git_commit || 'df793163d5821791d4e7caf88885a2c11a107986' }}
47-
CPYTHON_RELEASE: ${{ github.event.inputs.cpython_release || '3.14.2' }}
46+
GIT_COMMIT: ${{ github.event.inputs.git_commit || '55ea59e7dc35e1363b203ae4dd9cfc3a0ac0a844' }}
47+
CPYTHON_RELEASE: ${{ github.event.inputs.cpython_release || '3.15.0a8' }}
4848

4949
jobs:
5050
verify-input:
@@ -53,6 +53,7 @@ jobs:
5353
outputs:
5454
build-docs: ${{ steps.select-jobs.outputs.docs }}
5555
build-android: ${{ steps.select-jobs.outputs.android }}
56+
build-ios: ${{ steps.select-jobs.outputs.ios }}
5657
steps:
5758
- name: "Workflow run information"
5859
run: |
@@ -260,11 +261,45 @@ jobs:
260261
repository: "${{ env.GIT_REMOTE }}/cpython"
261262
ref: "v${{ env.CPYTHON_RELEASE }}"
262263

264+
# Python 3.15 moved the build tools to the Platforms directory. Add a
265+
# compatibility shim to simplify execution. Can be removed when 3.14
266+
# reaches EOL
267+
- name: Set up compatibility symlink
268+
run: |
269+
if [ ! -e Platforms/Android ]; then
270+
mkdir -p Platforms
271+
ln -s ../Android Platforms/Android
272+
ln -s ./android.py Android/__main__.py
273+
fi
274+
263275
- name: Build and test
264-
run: ./Android/android.py ci --fast-ci "$triplet"
276+
run: python3 Platforms/Android ci --fast-ci "$triplet"
265277

266278
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
267279
with:
268280
name: ${{ env.triplet }}
269281
path: cross-build/${{ env.triplet }}/dist/*
270282
if-no-files-found: error
283+
284+
build-ios:
285+
name: build-iOS
286+
needs:
287+
- verify-input
288+
if: fromJSON(needs.verify-input.outputs.build-ios)
289+
runs-on: macos-14
290+
timeout-minutes: 60
291+
steps:
292+
- name: "Checkout ${{ env.GIT_REMOTE }}/cpython"
293+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
294+
with:
295+
persist-credentials: false
296+
repository: "${{ env.GIT_REMOTE }}/cpython"
297+
ref: "v${{ env.CPYTHON_RELEASE }}"
298+
299+
- name: Build and test
300+
run: python3 Platforms/Apple ci iOS --slow-ci
301+
302+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
303+
with:
304+
path: cross-build/dist/*
305+
if-no-files-found: error

add_to_pydotorg.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,17 @@ def get_file_descriptions(
150150
),
151151
),
152152
(
153-
rx(r"aarch64-linux-android.tar.gz$"),
153+
rx(r"-aarch64-linux-android.tar.gz$"),
154154
("Android embeddable package (aarch64)", "android", False, ""),
155155
),
156156
(
157-
rx(r"x86_64-linux-android.tar.gz$"),
157+
rx(r"-x86_64-linux-android.tar.gz$"),
158158
("Android embeddable package (x86_64)", "android", False, ""),
159159
),
160+
(
161+
rx(r"-iOS-XCframework.tar.gz$"),
162+
("iOS XCframework", "ios", False, ""),
163+
),
160164
]
161165

162166

select_jobs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def main() -> None:
2121
# Android binary releases began in Python 3.14.
2222
output("android", version.as_tuple() >= (3, 14))
2323

24+
# iOS binary releases began in Python 3.15.
25+
output("ios", version.as_tuple() >= (3, 15))
26+
2427

2528
if __name__ == "__main__":
2629
main()

tests/fake-ftp-files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ python-3.14.0b2t-amd64.zip
522522
python-3.14.0b2t-arm64.zip
523523
python-3.14.0b2t-win32.zip
524524
python-3.14.0b3-aarch64-linux-android.tar.gz
525+
Python-3.14.0b3-iOS-XCframework.tar.gz
525526
python-3.14.0b3-amd64.exe
526527
python-3.14.0b3-amd64.exe.crt
527528
python-3.14.0b3-amd64.exe.sig

tests/test_add_to_pydotorg.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ def test_list_files(fs: FakeFilesystem) -> None:
160160

161161
# Assert
162162
assert files == [
163+
(
164+
"Python-3.14.0b3-iOS-XCframework.tar.gz",
165+
"iOS XCframework",
166+
"ios",
167+
False,
168+
"",
169+
),
163170
("Python-3.14.0b3.tar.xz", "XZ compressed source tarball", "source", True, ""),
164171
("Python-3.14.0b3.tgz", "Gzipped source tarball", "source", False, ""),
165172
(

tests/test_select_jobs.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@
77

88

99
@pytest.mark.parametrize(
10-
("version", "docs", "android"),
10+
("version", "docs", "android", "ios"),
1111
[
12-
("3.13.0a1", "false", "false"),
13-
("3.13.0rc1", "true", "false"),
14-
("3.13.0", "true", "false"),
15-
("3.13.1", "true", "false"),
16-
("3.14.0b2", "false", "true"),
17-
("3.14.0rc1", "true", "true"),
18-
("3.14.0", "true", "true"),
19-
("3.14.1", "true", "true"),
20-
("3.15.0a1", "false", "true"),
21-
("3.15.0", "true", "true"),
12+
("3.13.0a1", "false", "false", "false"),
13+
("3.13.0rc1", "true", "false", "false"),
14+
("3.13.0", "true", "false", "false"),
15+
("3.13.1", "true", "false", "false"),
16+
("3.14.0b2", "false", "true", "false"),
17+
("3.14.0rc1", "true", "true", "false"),
18+
("3.14.0", "true", "true", "false"),
19+
("3.14.1", "true", "true", "false"),
20+
("3.15.0a1", "false", "true", "true"),
21+
("3.15.0", "true", "true", "true"),
2222
],
2323
)
2424
def test_select_jobs(
2525
version: str,
2626
docs: str,
2727
android: str,
28+
ios: str,
2829
monkeypatch: pytest.MonkeyPatch,
2930
capsys: pytest.CaptureFixture[str],
3031
) -> None:
@@ -34,5 +35,6 @@ def test_select_jobs(
3435
f"""\
3536
docs={docs}
3637
android={android}
38+
ios={ios}
3739
"""
3840
)

0 commit comments

Comments
 (0)