@@ -41,38 +41,71 @@ jobs:
41
41
42
42
- name : Upload Coverage
43
43
uses : codecov/codecov-action@v4
44
- publish :
44
+ release-please :
45
45
needs : test
46
- if : ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/main' && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.repository_owner == 'supabase' }}
47
46
runs-on : ubuntu-latest
48
- name : " Bump version, create changelog and publish"
47
+ name : " Bump version and create changelog"
48
+ permissions :
49
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
50
+ contents : write # needed for github actions bot to write to repo
51
+ pull-requests : write
52
+ steps :
53
+ - uses : googleapis/release-please-action@v4
54
+ id : release
55
+ with :
56
+ target-branch : ${{ github.ref_name }}
57
+
58
+ - if : ${{ steps.release.outputs }}
59
+ id : versions
60
+ run : |
61
+ set -ex
62
+
63
+ MAIN_RELEASE_VERSION=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
64
+ RELEASE_VERSION="$MAIN_RELEASE_VERSION"
65
+ RELEASE_NAME="v$RELEASE_VERSION"
66
+ RELEASE_CREATED='${{ steps.release.outputs.release_created }}'
67
+ PRS_CREATED='${{ steps.release.outputs.prs_created }}'
68
+ PR_TITLE='${{ github.event.head_commit.message }}'
69
+
70
+ echo "MAIN_RELEASE_VERSION=${MAIN_RELEASE_VERSION}" >> "${GITHUB_OUTPUT}"
71
+ echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_OUTPUT}"
72
+ echo "RELEASE_CREATED=${RELEASE_CREATED}" >> "${GITHUB_OUTPUT}"
73
+ echo "RELEASE_NAME=${RELEASE_NAME}" >> "${GITHUB_OUTPUT}"
74
+ echo "PRS_CREATED=${PRS_CREATED}" >> "${GITHUB_OUTPUT}"
75
+ echo "PR_TITLE=${PR_TITLE}" >> "${GITHUB_OUTPUT}"
76
+ publish :
77
+ needs : release-please
78
+ if : ${{ startsWith(github.event.head_commit.message, 'chore(main)') && github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository_owner == 'supabase' }}
79
+ runs-on : ubuntu-latest
80
+ name : " Publish to PyPi"
49
81
environment :
50
82
name : pypi
51
83
url : https://pypi.org/p/storage3
52
84
permissions :
53
85
id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
54
86
contents : write # needed for github actions bot to write to repo
55
87
steps :
88
+ - name : Set up Python 3.11
89
+ uses : actions/setup-python@v5
90
+ with :
91
+ python-version : 3.11
92
+
56
93
- name : Clone Repository
57
94
uses : actions/checkout@v4
58
95
with :
59
96
ref : ${{ github.ref }}
60
97
fetch-depth : 0
61
- token : ${{ secrets.SILENTWORKS_PAT }}
62
- - name : Python Semantic Release
63
- id : release
64
- uses :
python-semantic-release/[email protected]
98
+
99
+ - name : Set up Poetry
100
+ uses : abatilo/actions-poetry@v3
65
101
with :
66
- github_token : ${{ secrets.GITHUB_TOKEN }}
102
+ poetry-version : 1.8.3
103
+
104
+ - name : Install dependencies
105
+ run : poetry install
106
+
107
+ - name : Build package dist directory
108
+ run : poetry build
67
109
68
110
- name : Publish package distributions to PyPI
69
111
uses : pypa/gh-action-pypi-publish@release/v1
70
- # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
71
- # See https://github.com/actions/runner/issues/1173
72
- if : steps.release.outputs.released == 'true'
73
-
74
- - name : Publish package distributions to GitHub Releases
75
- uses : python-semantic-release/upload-to-gh-release@main
76
- if : steps.release.outputs.released == 'true'
77
- with :
78
- github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments