Skip to content

Commit 166fa7c

Browse files
fix: add semver (#297)
* fix: add semver * fix: add environ and perms --------- Co-authored-by: [email protected] <[email protected]>
1 parent 324fa53 commit 166fa7c

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

.github/workflows/ci.yml

+19-3
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,31 @@ jobs:
3131
if: ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository_owner == 'supabase-community' }}
3232
runs-on: ubuntu-latest
3333
name: "Bump version, create changelog and publish"
34+
environment:
35+
name: pypi
36+
url: https://pypi.org/p/postgrest
37+
permissions:
38+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
39+
contents: write # needed for github actions bot to write to repo
3440
steps:
3541
- name: Clone Repository
3642
uses: actions/checkout@v2
3743
with:
3844
ref: ${{ github.ref }}
3945
fetch-depth: 0
4046
- name: Python Semantic Release
41-
uses: relekang/python-semantic-release@master
47+
id: release
48+
uses: python-semantic-release/[email protected]
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Publish package distributions to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1
54+
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
55+
# See https://github.com/actions/runner/issues/1173
56+
if: steps.release.outputs.released == 'true'
57+
58+
- name: Python Semantic Release
59+
uses: python-semantic-release/upload-to-gh-release@master
4260
with:
4361
github_token: ${{ secrets.GITHUB_TOKEN }}
44-
repository_username: __token__
45-
repository_password: ${{ secrets.PYPI_TOKEN }}

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "postgrest"
33
version = "0.10.8"
44
description = "PostgREST client for Python. This library provides an ORM interface to PostgREST."
5-
authors = ["Lương Quang Mạnh <[email protected]>", "Joel Lee <[email protected]>", "Anand"]
5+
authors = ["Lương Quang Mạnh <[email protected]>", "Joel Lee <[email protected]>", "Anand", "Oliver Rice"]
66
homepage = "https://github.com/supabase-community/postgrest-py"
77
repository = "https://github.com/supabase-community/postgrest-py"
88
documentation = "https://postgrest-py.rtfd.io"
@@ -40,7 +40,7 @@ furo = "^2023.5.20"
4040

4141
[tool.semantic_release]
4242
version_variable = "postgrest/__init__.py:__version__"
43-
version_toml = "pyproject.toml:tool.poetry.version"
43+
version_toml = ["pyproject.toml:tool.poetry.version"]
4444
major_on_zero = false
4545
commit_subject = "chore(release): bump version to v{version}"
4646
build_command = "curl -sSL https://install.python-poetry.org | python - && export PATH=\"/github/home/.local/bin:$PATH\" && poetry install && poetry build"

0 commit comments

Comments
 (0)