Add workflow to build non-framework binaries. #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update binary | ||
|
Check failure on line 1 in .github/workflows/update-binary.yml
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'b*' | ||
| jobs: | ||
| build-stubs: | ||
| name: Build stub binaries | ||
| runs-on: macos-26 | ||
| strategy: | ||
| 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" else "" }} | ||
| 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 | ||
| - name: Checkout Template | ||
| uses: actions/checkout@v6.0.3 | ||
| - name: Setup Python ${{ matrix.python-version }} | ||
| if: ${{ matrix.framework }} | ||
| uses: actions/setup-python@v6.2.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| allow-prereleases: true | ||
| - name: Setup Miniconda | ||
| if: ${{ !matrix.framework }} | ||
| uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| auto-update-conda: true | ||
| activate-environment: briefcase-env | ||
| - name: Install Dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| # TEMP: use the WIP branch to build | ||
| python -m pip install git+https://github.com/freakboy3742/briefcase.git@alt-env-support | ||
| - name: Generate Xcode App Template | ||
| run: | | ||
| # Generate the stub app | ||
| cd stub | ||
| briefcase create macOS Xcode -C env_manager=${{ !matrix.framework && "conda" || "pip" }} | ||
| briefcase build macOS Xcode | ||
| echo "Build ${{ env.PYTHON_TAG }}-${{ env.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" ${{ env.STUB_PREFIX }}Stub | ||
| codesign --remove-signature ${{ env.STUB_PREFIX }}Stub | ||
| zip Console-${{ env.STUB_PREFIX }}Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip ${{ env.STUB_PREFIX }}Stub | ||
| echo "Build ${{ env.PYTHON_TAG }}-${{ env.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" ${{ env.STUB_PREFIX }}Stub | ||
| codesign --remove-signature ${{ env.STUB_PREFIX }}Stub | ||
| zip GUI-${{ env.STUB_PREFIX }}Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip ${{ env.STUB_PREFIX }}Stub | ||
| echo "Stub binaries:" | ||
| ls -1 *.zip | ||
| - name: Upload build artefacts | ||
| uses: actions/upload-artifact@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-${{ env.STUB_PREFIX }}Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/macOS/Console-${{ env.STUB_PREFIX }}Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip | ||
| aws s3 cp stub/GUI-${{ env.STUB_PREFIX }}Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/macOS/GUI-${{ env.STUB_PREFIX }}Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip | ||
| make-release: | ||
| name: Make Release | ||
| runs-on: macOS-latest | ||
| needs: [ build-stubs ] | ||
| steps: | ||
| - name: Get build artifacts | ||
| uses: actions/download-artifact@v8.0.1 | ||
| with: | ||
| path: dist | ||
| merge-multiple: true | ||
| - name: Create Release | ||
| uses: ncipollo/release-action@v1.21.0 | ||
| with: | ||
| name: ${{ needs.build-stubs.outputs.BUILD_NUMBER }} | ||
| tag: ${{ needs.build-stubs.outputs.BUILD_NUMBER }} | ||
| draft: true | ||
| body: | | ||
| Build ${{ needs.build-stubs.outputs.BUILD_NUMBER }} of the Briefcase macOS stub binary. | ||
| Includes support for Python 3.10-3.14. | ||
| artifacts: "dist/*" | ||