From b63e770acbbfd7e0bf99b62e7addc12fa35b7e78 Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Fri, 24 May 2024 16:01:57 -0400 Subject: [PATCH] Experiment with `hynek/build-and-inspect-python-package` --- .github/workflows/ci.yml | 8 ++- .github/workflows/python-package-create.yml | 54 ++++++++++++--------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c6733bc..9a3d4f89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: - main concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true defaults: @@ -169,7 +169,7 @@ jobs: strategy: fail-fast: false matrix: - repo: [ briefcase, gbulb, rubicon-objc, toga ] + repo: [ briefcase, gbulb, rubicon-objc, toga, toga-android ] include: - tox-source: .[dev] - dist-path: dist @@ -184,6 +184,10 @@ jobs: tox-source: ./core[dev] dist-path: "*/dist/*" build-subdir: core + - repo: toga-android + tox-source: ./core[dev] + dist-path: "*/dist/*" + build-subdir: android test-verify-projects-briefcase: name: Verify Project diff --git a/.github/workflows/python-package-create.yml b/.github/workflows/python-package-create.yml index 5147069c..7a13fdc8 100644 --- a/.github/workflows/python-package-create.yml +++ b/.github/workflows/python-package-create.yml @@ -54,7 +54,7 @@ jobs: name: Create Python Package runs-on: ${{ inputs.runner-os }} outputs: - artifact-name: packages-${{ steps.package.outputs.name }} + artifact-name: "Packages-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }}" steps: - name: Determine Package Name @@ -67,32 +67,38 @@ jobs: repository: ${{ inputs.repository }} fetch-depth: 0 # Fetch all refs so setuptools_scm can generate the correct version number - - name: Setup Python - uses: actions/setup-python@v5.1.0 + - name: Build & Upload Package + uses: hynek/build-and-inspect-python-package@v2.5.0 with: - python-version: ${{ inputs.python-version }} - cache: pip - cache-dependency-path: | - **/setup.cfg - **/pyproject.toml + path: ${{ inputs.build-subdirectory || '.' }} + upload-name-suffix: "-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }}" - - name: Update pip - run: python -m pip install -U pip + # - name: Setup Python + # uses: actions/setup-python@v5.1.0 + # with: + # python-version: ${{ inputs.python-version }} + # cache: pip + # cache-dependency-path: | + # **/setup.cfg + # **/pyproject.toml - - name: Install tox - run: python -m pip install ${{ inputs.tox-source }} + # - name: Update pip + # run: python -m pip install -U pip - - name: Build Wheels - if: inputs.build-subdirectory == '' - run: tox -e package${{ inputs.tox-factors }} + # - name: Install tox + # run: python -m pip install ${{ inputs.tox-source }} - - name: Build Wheels from Subdirectory - if: inputs.build-subdirectory != '' - run: tox -e package${{ inputs.tox-factors }} -- ${{ inputs.build-subdirectory }} + # - name: Build Wheels + # if: inputs.build-subdirectory == '' + # run: tox -e package${{ inputs.tox-factors }} - - name: Upload Package - uses: actions/upload-artifact@v4.3.3 - with: - name: packages-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }} - path: ${{ inputs.distribution-path }} - if-no-files-found: error + # - name: Build Wheels from Subdirectory + # if: inputs.build-subdirectory != '' + # run: tox -e package${{ inputs.tox-factors }} -- ${{ inputs.build-subdirectory }} + + # - name: Upload Package + # uses: actions/upload-artifact@v4.3.3 + # with: + # name: packages-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }} + # path: ${{ inputs.distribution-path }} + # if-no-files-found: error