Use -dev python releases in dev branch. #135
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: | |
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: | |
- uses: actions/checkout@v4 | |
- name: Set build variables | |
id: build-vars | |
env: | |
TAG_NAME: ${{ github.ref }} | |
run: | | |
export TAG=$(basename $TAG_NAME) | |
echo "TAG=${TAG}" | |
export PYTHON_VER="${TAG%-*}" | |
export 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} | |
- name: Set up Python | |
uses: actions/setup-python@v4.7.1 | |
with: | |
python-version: "${{ steps.build-vars.output.PYTHON_VER }}-dev" | |
- name: Build ${{ matrix.target }} | |
run: | | |
# Do the build for the requested target. | |
make ${{ matrix.target }} BUILD_NUMBER=${{ steps.build-vars.output.BUILD_NUMBER }} | |
- name: Extract version details | |
id: version-details | |
run: | | |
export PYTHON_VERSION=$(grep "Python version:" support/${{ steps.build-vars.output.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 3) | |
export BZIP2_VERSION=$(grep "BZip2:" support/${{ steps.build-vars.output.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) | |
export XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.output.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) | |
export OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.output.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) | |
export LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.output.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) | |
echo "PYTHON_VERSION=${PYTHON_VERSION}" | |
echo "BZIP2_VERSION=${BZIP2_VERSION}" | |
echo "XZ_VERSION=${XZ_VERSION}" | |
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | |
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | |
echo "PYTHON_VERSION=${PYTHON_VERSION}" >> ${GITHUB_OUTPUT} | |
echo "BZIP2_VERSION=${BZIP2_VERSION}" >> ${GITHUB_OUTPUT} | |
echo "XZ_VERSION=${XZ_VERSION}" >> ${GITHUB_OUTPUT} | |
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" >> ${GITHUB_OUTPUT} | |
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" >> ${GITHUB_OUTPUT} | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: dist | |
path: "dist" | |
if-no-files-found: error | |
make-release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Get build artifacts | |
uses: actions/download-artifact@v3.0.2 | |
with: | |
name: dist | |
path: dist | |
- name: Create Release | |
uses: ncipollo/release-action@v1.13.0 | |
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/*" |