Skip to content

More permission tweaks. #29

More permission tweaks.

More permission tweaks. #29

Workflow file for this run

name: Update binary
on:
push:
tags:
- 'b*'
permissions: {}
jobs:
build-stubs:
name: Build stub binaries
runs-on: macos-26
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
framework: [true, false]
outputs:
BUILD_NUMBER: ${{ steps.build-vars.outputs.BUILD_NUMBER }}
steps:
- name: Set Build Variables
id: build-vars
env:
TAG_NAME: ${{ github.ref }}
run: |
export BUILD_NUMBER=$(basename $TAG_NAME)
export PYTHON_TAG=$(python -c "print('${{ matrix.python-version }}'.split('-')[0])")
export STUB_PREFIX=${{ !matrix.framework && 'L' || '' }}
echo "PYTHON_TAG=${PYTHON_TAG}" | tee -a $GITHUB_ENV
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a $GITHUB_ENV
echo "STUB_PREFIX=${STUB_PREFIX}" | tee -a $GITHUB_ENV
# Expose BUILD_NUMBER as a step output so it can be consumed as a job output
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a $GITHUB_OUTPUT
- name: Checkout Template
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python ${{ matrix.python-version }}
if: ${{ matrix.framework }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Setup Miniconda
if: ${{ !matrix.framework }}
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
activate-environment: briefcase-env
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
# TODO: use the WIP branch to build until the feature is finalized.
python -m pip install git+https://github.com/freakboy3742/briefcase.git@alt-env-support
- name: Create Framework stub app
if: ${{ matrix.framework }}
run: |
# Generate the stub app
cd stub
briefcase create macOS Xcode
- name: Create Non-framework stub app
if: ${{ !matrix.framework }}
run: |
# Generate the stub app
cd stub
briefcase create macOS Xcode -C env_manager=\"conda\" -C universal_build=false
- name: Build Stub App
run: |
cd stub
briefcase build macOS Xcode
echo "Build ${PYTHON_TAG}-${BUILD_NUMBER} ${{ !matrix.framework && 'non-framework' || 'framework' }} console stub artefact"
mv "./build/console-stub/macos/xcode/build/Release/Console Stub.app/Contents/MacOS/Console Stub" Stub
codesign --remove-signature Stub
zip Console-${STUB_PREFIX}Stub-${PYTHON_TAG}-${BUILD_NUMBER}.zip Stub
echo "Build ${PYTHON_TAG}-${BUILD_NUMBER} ${{ !matrix.framework && 'non-framework' || 'framework' }} GUI stub artefact"
mv "./build/gui-stub/macos/xcode/build/Release/GUI Stub.app/Contents/MacOS/GUI Stub" Stub
codesign --remove-signature Stub
zip GUI-${STUB_PREFIX}Stub-${PYTHON_TAG}-${BUILD_NUMBER}.zip Stub
echo "Stub binaries:"
ls -1 *.zip
- name: Upload build artefacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.PYTHON_TAG }}-${{ env.STUB_PREFIX }}Stubs
path: stub/*.zip
- name: Upload Release Asset to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
python -m pip install -U pip
python -m pip install -U setuptools
python -m pip install awscli
aws s3 cp stub/Console-${STUB_PREFIX}Stub-${PYTHON_TAG}-${BUILD_NUMBER}.zip s3://briefcase-support/python/${PYTHON_TAG}/macOS/Console-${STUB_PREFIX}Stub-${PYTHON_TAG}-${BUILD_NUMBER}.zip
aws s3 cp stub/GUI-${STUB_PREFIX}Stub-${PYTHON_TAG}-${BUILD_NUMBER}.zip s3://briefcase-support/python/${PYTHON_TAG}/macOS/GUI-${STUB_PREFIX}Stub-${PYTHON_TAG}-${BUILD_NUMBER}.zip
make-release:
name: Make Release
runs-on: macos-26
needs: [ build-stubs ]
permissions:
contents: write
steps:
- name: Get build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: dist
merge-multiple: true
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
BUILD_NUMBER: ${{ needs.build-stubs.outputs.BUILD_NUMBER }}
run: |
gh release create "${BUILD_NUMBER}" dist/* \
--repo "${GITHUB_REPOSITORY}" \
--title "${BUILD_NUMBER}" \
--draft \
--notes "$(printf 'Build %s of the Briefcase macOS stub binary.\n\nIncludes support for Python 3.10-3.14.\n' "${BUILD_NUMBER}")"