Skip to content

Commit

Permalink
Add a workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
qqfunc authored Aug 16, 2024
1 parent 84eb579 commit a936954
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
push:
branches: ['main']
pull_request:
branches: ['main']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build

runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.13-dev']
build-host:
- 'arm64-apple-ios'
- 'arm64-apple-ios-simulator'
- 'x86_64-apple-ios-simulator'

steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: py
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Download Python ${{ steps.py.outputs.python-version }} source code
run: |
curl -O Python.tgz $(python ./geturl.py)
tar -xf Python.tgz
- name: Add iOS/Resources/bin to PATH
working-directory: Python
run: echo "$(pwd)/iOS/Resources/bin" >> $GITHUB_PATH
- name: Configure
working-directory: Python
run: >
./configure
--enable-framework="./iOS/Frameworks/main/"
--host=${{ matrix.build-host }}
--build=arm64-apple-darwin
--with-build-python="${{ steps.py.outputs.python-path }}"
- name: Build Python.framework
working-directory: Python
run: |
make
make install
9 changes: 9 additions & 0 deletions geturl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Get a download URL for an installed version of Python"""

import platform
import sys

version1 = ".".join(map(lambda n: str(n), sys.version_info[0:3]))
version2 = platform.python_version()

print("https://www.python.org/ftp/python/{version1}/Python-{version2}.tgz")

0 comments on commit a936954

Please sign in to comment.