Merge pull request #191 from beeware/framework-lib #137
Workflow file for this run
This file contains 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
# This is the DEV workflow. | |
# Run this Action on creating a new tag matching "<version>-b<build>" | |
# e.g., 3.7-b1 | |
name: Build support package | |
on: | |
push: | |
tags: | |
- '*-b*' | |
jobs: | |
build: | |
name: Build | |
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] | |
- 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 | |
make-release: | |
name: Make Release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Get build artifacts | |
uses: actions/[email protected] | |
with: | |
pattern: dist-* | |
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 }} | |
draft: true | |
body: | | |
Build ${{ needs.build.outputs.BUILD_NUMBER }} of the BeeWare support package for Python ${{ needs.build.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 }} | |
artifacts: "dist/*" |