diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 380a313..3c1627d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,34 @@ on: 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.build.outputs.PYTHON_VER }} + PYTHON_VERSION: + description: "The full Python version." + value: ${{ jobs.build.outputs.PYTHON_VERSION }} + BZIP2_VERSION: + description: "The BZip2 version used for the build." + value: ${{ jobs.build.outputs.BZIP2_VERSION }} + LIBFFI_VERSION: + description: "The libFFI version used for the build." + value: ${{ jobs.build.outputs.LIBFFI_VERSION }} + MPDECIMAL_VERSION: + description: "The mpdecimal version used for the build." + value: ${{ jobs.build.outputs.MPDECIMAL_VERSION }} + OPENSSL_VERSION: + description: "The OpenSSL version used for the build." + value: ${{ jobs.build.outputs.OPENSSL_VERSION }} + XZ_VERSION: + description: "The XZ version used for the build." + value: ${{ jobs.build.outputs.XZ_VERSION }} env: FORCE_COLOR: "1" @@ -36,6 +64,15 @@ jobs: briefcase-run-args: ' -d "iPhone SE (3rd generation)"' run-tests: true + outputs: + PYTHON_VER: ${{ steps.config-vars.outputs.PYTHON_VER }} + PYTHON_VERSION: ${{ steps.config-vars.outputs.PYTHON_VERSION }} + BZIP2_VERSION: ${{ steps.config-vars.outputs.BZIP2_VERSION }} + LIBFFI_VERSION: ${{ steps.config-vars.outputs.LIBFFI_VERSION }} + MPDECIMAL_VERSION: ${{ steps.config-vars.outputs.MPDECIMAL_VERSION }} + OPENSSL_VERSION: ${{ steps.config-vars.outputs.OPENSSL_VERSION }} + XZ_VERSION: ${{ steps.config-vars.outputs.XZ_VERSION }} + steps: - uses: actions/checkout@v4.1.7 @@ -43,7 +80,20 @@ jobs: id: config-vars 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) + echo "PYTHON_VER=${PYTHON_VER}" | tee -a ${GITHUB_OUTPUT} + echo "PYTHON_VERSION=${PYTHON_VERSION}" | 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} - name: Set up Python uses: actions/setup-python@v5.1.1 @@ -55,7 +105,7 @@ jobs: - name: Build ${{ matrix.target }} run: | # Do the build for the requested target. - make ${{ matrix.target }} + make ${{ matrix.target }} BUILD_NUMBER=${{ inputs.attest-package }} - name: Upload build artefacts uses: actions/upload-artifact@v4.3.5 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b49127c..d03a091 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,76 +8,36 @@ 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/checkout@v4.1.1 + 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/setup-python@v5.1.1 - 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) - LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2) - MPDECIMAL_VERSION=$(grep "mpdecimal:" 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) - XZ_VERSION=$(grep "XZ:" 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 "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} - - - name: Upload Build Artifact - uses: actions/upload-artifact@v4.3.5 - 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/download-artifact@v4.1.8 @@ -89,17 +49,17 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1.14.0 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 }} - * BZip2 ${{ needs.build.outputs.BZIP2_VERSION }} - * libFFI ${{ needs.build.outputs.LIBFFI_VERSION }} - * mpdecimal ${{ needs.build.outputs.MPDECIMAL_VERSION }} - * OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }} - * XZ ${{ needs.build.outputs.XZ_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/*"