diff --git a/.github/workflows/manual_release_beta.yaml b/.github/workflows/manual_release_beta.yaml index b820ac6..f56b8ee 100644 --- a/.github/workflows/manual_release_beta.yaml +++ b/.github/workflows/manual_release_beta.yaml @@ -1,11 +1,16 @@ name: Beta release on: - # Runs when manually triggered from the GitHub UI. + # Runs when manually triggered from the GitHub UI, or dispatched from `on_master.yaml` + # via the `apify/workflows/execute-workflow` action for the automatic beta release on push to master. + # Note: This workflow is intentionally NOT a reusable workflow (no `workflow_call`) because PyPI's + # Trusted Publishing does not currently support reusable workflows. + # See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github workflow_dispatch: - # Runs when invoked by another workflow. - workflow_call: +concurrency: + group: release + cancel-in-progress: false permissions: contents: read @@ -16,7 +21,6 @@ jobs: runs-on: ubuntu-latest outputs: version_number: ${{ steps.release_prepare.outputs.version_number }} - tag_name: ${{ steps.release_prepare.outputs.tag_name }} changelog: ${{ steps.release_prepare.outputs.changelog }} steps: - uses: apify/workflows/git-cliff-release@main diff --git a/.github/workflows/on_master.yaml b/.github/workflows/on_master.yaml index e2dca8d..1e7c549 100644 --- a/.github/workflows/on_master.yaml +++ b/.github/workflows/on_master.yaml @@ -22,13 +22,19 @@ jobs: name: Tests uses: ./.github/workflows/_tests.yaml + # The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`) + # because PyPI's Trusted Publishing does not currently support reusable workflows. + # See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github beta_release: # Skip this for "ci", "docs" and "test" commits and for forks. if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'test') && startsWith(github.repository, 'apify/')" name: Beta release needs: [code_checks, tests] + runs-on: ubuntu-latest permissions: - contents: write - id-token: write - uses: ./.github/workflows/manual_release_beta.yaml - secrets: inherit + actions: write # Required by execute-workflow. + steps: + - name: Dispatch beta release workflow + uses: apify/workflows/execute-workflow@main + with: + workflow: manual_release_beta.yaml