@@ -22,13 +22,58 @@ jobs:
2222 name : Tests
2323 uses : ./.github/workflows/_tests.yaml
2424
25- beta_release :
25+ # The beta release jobs are intentionally inlined here (instead of calling
26+ # `manual_release_beta.yaml` via `uses:`) because PyPI's Trusted Publishing
27+ # does not currently support reusable workflows.
28+ # See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
29+ release_prepare :
2630 # Skip this for "ci", "docs" and "test" commits and for forks.
2731 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/')"
28- name : Beta release
32+ name : Beta release / Release prepare
2933 needs : [code_checks, tests]
34+ runs-on : ubuntu-latest
35+ outputs :
36+ version_number : ${{ steps.release_prepare.outputs.version_number }}
37+ tag_name : ${{ steps.release_prepare.outputs.tag_name }}
38+ changelog : ${{ steps.release_prepare.outputs.changelog }}
39+ steps :
40+ - uses : apify/workflows/git-cliff-release@main
41+ id : release_prepare
42+ name : Release prepare
43+ with :
44+ release_type : prerelease
45+ existing_changelog_path : CHANGELOG.md
46+
47+ changelog_update :
48+ name : Beta release / Changelog update
49+ needs : [release_prepare]
3050 permissions :
3151 contents : write
32- id-token : write
33- uses : ./.github/workflows/manual_release_beta.yaml
52+ uses : apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
53+ with :
54+ version_number : ${{ needs.release_prepare.outputs.version_number }}
55+ changelog : ${{ needs.release_prepare.outputs.changelog }}
3456 secrets : inherit
57+
58+ pypi_publish :
59+ name : Beta release / PyPI publish
60+ needs : [release_prepare, changelog_update]
61+ runs-on : ubuntu-latest
62+ permissions :
63+ contents : write
64+ id-token : write # Required for OIDC authentication.
65+ environment :
66+ name : pypi
67+ url : https://pypi.org/project/apify-shared
68+ steps :
69+ - name : Prepare distribution
70+ uses : apify/workflows/prepare-pypi-distribution@main
71+ with :
72+ package_name : apify-shared
73+ is_prerelease : " yes"
74+ version_number : ${{ needs.release_prepare.outputs.version_number }}
75+ ref : ${{ needs.changelog_update.outputs.changelog_commitish }}
76+
77+ # Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
78+ - name : Publish package to PyPI
79+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments