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