Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to a framework-based approach for building support packages. #191

Merged
merged 14 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI
on:
pull_request:

env:
FORCE_COLOR: "1"

defaults:
run:
shell: bash

# Cancel active CI runs for a PR before starting another run
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
target: ['macOS', 'iOS', 'tvOS', 'watchOS']
include:
- briefcase-run-args:
- run-tests: false

- target: macOS
run-tests: true

- target: iOS
briefcase-run-args: ' -d "iPhone SE (3rd generation)"'
run-tests: true

steps:
- uses: actions/[email protected]

- name: Extract config variables
id: config-vars
run: |
PYTHON_VER=$(make config | grep "PYTHON_VER=" | cut -d "=" -f 2)
echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}

- name: Set up Python
uses: actions/[email protected]
with:
# Appending -dev ensures that we can always build the dev release.
# It's a no-op for versions that have been published.
python-version: ${{ steps.config-vars.outputs.PYTHON_VER }}-dev

- name: Build ${{ matrix.target }}
run: |
# Do the build for the requested target.
make ${{ matrix.target }}

- name: Upload build artefacts
uses: actions/[email protected]
with:
name: Python-${{ steps.config-vars.outputs.PYTHON_VER }}-${{ matrix.target }}-support.custom.tar.gz
path: dist/Python-${{ steps.config-vars.outputs.PYTHON_VER }}-${{ matrix.target }}-support.custom.tar.gz

- uses: actions/[email protected]
if: matrix.run-tests
with:
repository: beeware/Python-support-testbed
path: Python-support-testbed
# TODO - remove the py3.13 reference option.
ref: py3.13-support

- name: Install dependencies
if: matrix.run-tests
run: |
# TODO - Revert to the development version of Briefcase
# Use the development version of Briefcase
# python -m pip install git+https://github.com/beeware/briefcase.git
python -m pip install git+https://github.com/freakboy3742/briefcase.git@version-bumps

- name: Run support testbed check
if: matrix.run-tests
timeout-minutes: 10
working-directory: Python-support-testbed
# TODO - remove the template_branch option.
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\'
rmartin16 marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 6 additions & 10 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ jobs:
env:
TAG_NAME: ${{ github.ref }}
run: |
export TAG=$(basename $TAG_NAME)
echo "TAG=${TAG}"
export PYTHON_VER="${TAG%-*}"
export BUILD_NUMBER="${TAG#*-}"
TAG=$(basename $TAG_NAME)
PYTHON_VER="${TAG%-*}"
BUILD_NUMBER="${TAG#*-}"

echo "PYTHON_VER=${PYTHON_VER}"
echo "BUILD_NUMBER=${BUILD_NUMBER}"

echo "TAG=${TAG}" >> ${GITHUB_OUTPUT}
echo "PYTHON_VER=${PYTHON_VER}" >> ${GITHUB_OUTPUT}
echo "BUILD_NUMBER=${BUILD_NUMBER}" >> ${GITHUB_OUTPUT}
echo "TAG=${TAG}" | tee -a ${GITHUB_OUTPUT}
echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a ${GITHUB_OUTPUT}

- name: Update Release Asset to S3
env:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ jobs:
- name: Extract Version Details
id: version-details
run: |
export PYTHON_VERSION=$(grep "Python version:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 3)
export BZIP2_VERSION=$(grep "BZip2:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
export XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
export OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
export LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
PYTHON_VERSION=$(grep "Python version:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 3)
BZIP2_VERSION=$(grep "BZip2:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)

echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
Expand Down
Loading
Loading