From ec44d82e583b74780f070417b5123531f28b2908 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Mon, 4 May 2026 16:39:19 +0200 Subject: [PATCH] ci: add manually triggerable beta release workflow Extract the beta release pipeline into a new reusable workflow that can be invoked both manually from the GitHub UI and from on_master. --- .github/workflows/manual_release_beta.yaml | 74 ++++++++++++++++++++++ .github/workflows/on_master.yaml | 60 ++---------------- 2 files changed, 78 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/manual_release_beta.yaml diff --git a/.github/workflows/manual_release_beta.yaml b/.github/workflows/manual_release_beta.yaml new file mode 100644 index 00000000..5c83bfb4 --- /dev/null +++ b/.github/workflows/manual_release_beta.yaml @@ -0,0 +1,74 @@ +name: Beta release + +on: + # Runs when manually triggered from the GitHub UI. + workflow_dispatch: + + # Runs when invoked by another workflow. + workflow_call: + +permissions: + contents: read + +jobs: + release_prepare: + name: Release prepare + 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 + id: release_prepare + name: Release prepare + with: + release_type: prerelease + existing_changelog_path: CHANGELOG.md + + changelog_update: + name: Changelog update + needs: [release_prepare] + permissions: + contents: write + uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main + with: + version_number: ${{ needs.release_prepare.outputs.version_number }} + changelog: ${{ needs.release_prepare.outputs.changelog }} + secrets: inherit + + pypi_publish: + name: PyPI publish + needs: [release_prepare, changelog_update] + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write # Required for OIDC authentication. + environment: + name: pypi + url: https://pypi.org/project/apify-client + steps: + - name: Prepare distribution + uses: apify/workflows/prepare-pypi-distribution@main + with: + package_name: apify-client + is_prerelease: "yes" + version_number: ${{ needs.release_prepare.outputs.version_number }} + ref: ${{ needs.changelog_update.outputs.changelog_commitish }} + + # Publish the package to PyPI using PyPA official GitHub action with OIDC authentication. + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + doc_release_post_publish: + name: Doc release post publish + needs: [changelog_update, pypi_publish] + permissions: + contents: write + pages: write + id-token: write + uses: ./.github/workflows/manual_release_docs.yaml + with: + # Use the ref from the changelog update to include the updated changelog. + ref: ${{ needs.changelog_update.outputs.changelog_commitish }} + secrets: inherit diff --git a/.github/workflows/on_master.yaml b/.github/workflows/on_master.yaml index 1faa4fce..02c7449a 100644 --- a/.github/workflows/on_master.yaml +++ b/.github/workflows/on_master.yaml @@ -49,7 +49,7 @@ jobs: uses: ./.github/workflows/_tests.yaml secrets: inherit - release_prepare: + beta_release: # Run this only for "feat", "fix", "perf", "refactor" and "style" commits. if: >- startsWith(github.event.head_commit.message, 'feat') || @@ -57,63 +57,11 @@ jobs: startsWith(github.event.head_commit.message, 'perf') || startsWith(github.event.head_commit.message, 'refactor') || startsWith(github.event.head_commit.message, 'style') - name: Release prepare + name: Beta release needs: [code_checks, docstrings_checks, tests] - 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 - id: release_prepare - name: Release prepare - with: - release_type: prerelease - existing_changelog_path: CHANGELOG.md - - changelog_update: - name: Changelog update - needs: [release_prepare] - permissions: - contents: write - uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main - with: - version_number: ${{ needs.release_prepare.outputs.version_number }} - changelog: ${{ needs.release_prepare.outputs.changelog }} - secrets: inherit - - pypi_publish: - name: PyPI publish - needs: [release_prepare, changelog_update] - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write # Required for OIDC authentication. - environment: - name: pypi - url: https://pypi.org/project/apify-client - steps: - - name: Prepare distribution - uses: apify/workflows/prepare-pypi-distribution@main - with: - package_name: apify-client - is_prerelease: "yes" - version_number: ${{ needs.release_prepare.outputs.version_number }} - ref: ${{ needs.changelog_update.outputs.changelog_commitish }} - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - doc_release_post_publish: - name: Doc release post publish - needs: [changelog_update, pypi_publish] permissions: contents: write - pages: write id-token: write - uses: ./.github/workflows/manual_release_docs.yaml - with: - # Use the ref from the changelog update to include the updated changelog. - ref: ${{ needs.changelog_update.outputs.changelog_commitish }} + pages: write + uses: ./.github/workflows/manual_release_beta.yaml secrets: inherit