Skip to content

[pull] main from beeware:main #17

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

Merged
merged 8 commits into from
Aug 10, 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
89 changes: 78 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
name: CI
on:
pull_request:
push:
branches:
- main
- 3.*
workflow_call:
inputs:
build-number:
description: "The build number to add to the built package"
default: "custom"
type: "string"
outputs:
PYTHON_VER:
description: "The Python major.minor version."
value: ${{ jobs.config.outputs.PYTHON_VER }}
PYTHON_VERSION:
description: "The full Python version."
value: ${{ jobs.config.outputs.PYTHON_VERSION }}
BZIP2_VERSION:
description: "The BZip2 version used for the build."
value: ${{ jobs.config.outputs.BZIP2_VERSION }}
LIBFFI_VERSION:
description: "The libFFI version used for the build."
value: ${{ jobs.config.outputs.LIBFFI_VERSION }}
MPDECIMAL_VERSION:
description: "The mpdecimal version used for the build."
value: ${{ jobs.config.outputs.MPDECIMAL_VERSION }}
OPENSSL_VERSION:
description: "The OpenSSL version used for the build."
value: ${{ jobs.config.outputs.OPENSSL_VERSION }}
XZ_VERSION:
description: "The XZ version used for the build."
value: ${{ jobs.config.outputs.XZ_VERSION }}

env:
FORCE_COLOR: "1"
Expand All @@ -15,8 +47,49 @@ concurrency:
cancel-in-progress: true

jobs:
config:
runs-on: macOS-latest
outputs:
PYTHON_VER: ${{ steps.extract.outputs.PYTHON_VER }}
PYTHON_VERSION: ${{ steps.extract.outputs.PYTHON_VERSION }}
BUILD_NUMBER: ${{ steps.extract.outputs.BUILD_NUMBER }}
BZIP2_VERSION: ${{ steps.extract.outputs.BZIP2_VERSION }}
LIBFFI_VERSION: ${{ steps.extract.outputs.LIBFFI_VERSION }}
MPDECIMAL_VERSION: ${{ steps.extract.outputs.MPDECIMAL_VERSION }}
OPENSSL_VERSION: ${{ steps.extract.outputs.OPENSSL_VERSION }}
XZ_VERSION: ${{ steps.extract.outputs.XZ_VERSION }}

steps:
- uses: actions/[email protected]

- name: Extract config variables
id: extract
run: |
PYTHON_VER=$(make config | grep "PYTHON_VER=" | cut -d "=" -f 2)
PYTHON_VERSION=$(make config | grep "PYTHON_VERSION=" | cut -d "=" -f 2)
BZIP2_VERSION=$(make config | grep "BZIP2_VERSION=" | cut -d "=" -f 2)
LIBFFI_VERSION=$(make config | grep "LIBFFI_VERSION=" | cut -d "=" -f 2)
MPDECIMAL_VERSION=$(make config | grep "MPDECIMAL_VERSION=" | cut -d "=" -f 2)
OPENSSL_VERSION=$(make config | grep "OPENSSL_VERSION=" | cut -d "=" -f 2)
XZ_VERSION=$(make config | grep "XZ_VERSION=" | cut -d "=" -f 2)
if [ -z "${{ inputs.build-number }}" ]; then
BUILD_NUMBER=custom
else
BUILD_NUMBER=${{ inputs.build-number }}
fi

echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT}
echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a ${GITHUB_OUTPUT}
echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "MPDECIMAL_VERSION=${MPDECIMAL_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}

build:
runs-on: macOS-latest
needs: [ config ]
strategy:
fail-fast: false
matrix:
Expand All @@ -35,29 +108,23 @@ jobs:
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
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev

- name: Build ${{ matrix.target }}
run: |
# Do the build for the requested target.
make ${{ matrix.target }}
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}

- 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
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz

- uses: actions/[email protected]
if: matrix.run-tests
Expand All @@ -80,4 +147,4 @@ jobs:
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\'
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\'
16 changes: 8 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
python -m pip install -U setuptools
python -m pip install awscli
# macOS build
curl -o macOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PY_VERSION }}-macOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp macOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PY_VERSION }}/macOS/Python-${{ steps.build-vars.outputs.PY_VERSION }}-macOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
curl -o macOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-macOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp macOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PYTHON_VER }}/macOS/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-macOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
# iOS build
curl -o iOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PY_VERSION }}-iOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp iOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PY_VERSION }}/iOS/Python-${{ steps.build-vars.outputs.PY_VERSION }}-iOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
curl -o iOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-iOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp iOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PYTHON_VER }}/iOS/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-iOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
# tvOS build
curl -o tvOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PY_VERSION }}-tvOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp tvOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PY_VERSION }}/tvOS/Python-${{ steps.build-vars.outputs.PY_VERSION }}-tvOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
curl -o tvOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-tvOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp tvOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PYTHON_VER }}/tvOS/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-tvOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
# watchOS build
curl -o watchOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PY_VERSION }}-watchOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp watchOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PY_VERSION }}/watchOS/Python-${{ steps.build-vars.outputs.PY_VERSION }}-watchOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
curl -o watchOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-watchOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
aws s3 cp watchOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PYTHON_VER }}/watchOS/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-watchOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
77 changes: 20 additions & 57 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,95 +8,58 @@ on:
- '*-b*'

jobs:
build:
name: Build
config:
name: Build vars
runs-on: macOS-latest
outputs:
TAG: ${{ steps.build-vars.outputs.TAG }}
PYTHON_VER: ${{ steps.build-vars.outputs.PYTHON_VER }}
BUILD_NUMBER: ${{ steps.build-vars.outputs.BUILD_NUMBER }}
PYTHON_VERSION: ${{ steps.version-details.outputs.PYTHON_VERSION }}
BZIP2_VERSION: ${{ steps.version-details.outputs.BZIP2_VERSION }}
XZ_VERSION: ${{ steps.version-details.outputs.XZ_VERSION }}
LIBFFI_VERSION: ${{ steps.version-details.outputs.LIBFFI_VERSION }}
OPENSSL_VERSION: ${{ steps.version-details.outputs.OPENSSL_VERSION }}
strategy:
matrix:
target: [ "macOS", "iOS", "tvOS", "watchOS" ]
steps:
- name: Checkout
uses: actions/[email protected]

steps:
- name: Set Build Variables
id: build-vars
env:
TAG_NAME: ${{ github.ref }}
run: |
export TAG=$(basename $TAG_NAME)
export PYTHON_VER="${TAG%-*}"
export BUILD_NUMBER="${TAG#*-}"

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: Set up Python
uses: actions/[email protected]
with:
python-version: "${{ steps.build-vars.outputs.PYTHON_VER }}-dev"

- name: Build ${{ matrix.target }}
run: |
# Do the build for the requested target.
make ${{ matrix.target }} BUILD_NUMBER=${{ steps.build-vars.outputs.BUILD_NUMBER }}

- name: Extract Version Details
id: version-details
run: |
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}
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}

- name: Upload Build Artifact
uses: actions/[email protected]
with:
name: dist-${{ matrix.target }}
path: dist
if-no-files-found: error
ci:
name: CI
needs: [ config ]
uses: ./.github/workflows/ci.yaml
with:
build-number: ${{ needs.config.outputs.BUILD_NUMBER }}

make-release:
name: Make Release
runs-on: ubuntu-latest
needs: build
needs: [ config, ci ]
steps:
- name: Get build artifacts
uses: actions/[email protected]
with:
pattern: dist-*
pattern: Python-*
path: dist
merge-multiple: true

- name: Create Release
uses: ncipollo/[email protected]
with:
name: ${{ needs.build.outputs.PYTHON_VER }}-${{ needs.build.outputs.BUILD_NUMBER }}
tag: ${{ needs.build.outputs.PYTHON_VER }}-${{ needs.build.outputs.BUILD_NUMBER }}
name: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}
tag: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}
draft: true
body: |
Build ${{ needs.build.outputs.BUILD_NUMBER }} of the BeeWare support package for Python ${{ needs.build.outputs.PYTHON_VER }}.
Build ${{ needs.config.outputs.BUILD_NUMBER }} of the BeeWare support package for Python ${{ needs.ci.outputs.PYTHON_VER }}.

Includes:
* Python ${{ needs.build.outputs.PYTHON_VERSION }}
* OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }}
* BZip2 ${{ needs.build.outputs.BZIP2_VERSION }}
* XZ ${{ needs.build.outputs.XZ_VERSION }}
* LibFFI ${{ needs.build.outputs.LIBFFI_VERSION }}
* Python ${{ needs.ci.outputs.PYTHON_VERSION }}
* BZip2 ${{ needs.ci.outputs.BZIP2_VERSION }}
* libFFI ${{ needs.ci.outputs.LIBFFI_VERSION }}
* mpdecimal ${{ needs.ci.outputs.MPDECIMAL_VERSION }}
* OpenSSL ${{ needs.ci.outputs.OPENSSL_VERSION }}
* XZ ${{ needs.ci.outputs.XZ_VERSION }}
artifacts: "dist/*"
Loading
Loading