Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit d568a4f

Browse files
authored
ci: add release please to the workflow (#288)
1 parent 3c8eed4 commit d568a4f

File tree

11 files changed

+232
-528
lines changed

11 files changed

+232
-528
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,71 @@ jobs:
4141

4242
- name: Upload Coverage
4343
uses: codecov/codecov-action@v4
44-
publish:
44+
release-please:
4545
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' }}
4746
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"
4981
environment:
5082
name: pypi
5183
url: https://pypi.org/p/storage3
5284
permissions:
5385
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
5486
contents: write # needed for github actions bot to write to repo
5587
steps:
88+
- name: Set up Python 3.11
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: 3.11
92+
5693
- name: Clone Repository
5794
uses: actions/checkout@v4
5895
with:
5996
ref: ${{ github.ref }}
6097
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
65101
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
67109

68110
- name: Publish package distributions to PyPI
69111
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 }}

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Docs
22
on:
33
push:
44
branches:
5-
- main
5+
- docs
66
jobs:
77
build:
88
runs-on: ubuntu-latest

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.7.7"
3+
}

poetry.lock

Lines changed: 158 additions & 490 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ classifiers = [
1212
"Operating System :: OS Independent",
1313
]
1414
description = "Supabase Storage client for Python."
15-
documentation = "https://supabase-community.github.io/storage-py"
16-
homepage = "https://supabase-community.github.io/storage-py"
15+
documentation = "https://supabase.github.io/storage-py"
16+
homepage = "https://supabase.github.io/storage-py"
1717
license = "MIT"
1818
name = "storage3"
1919
readme = "README.md"
20-
repository = "https://github.com/supabase-community/storage-py"
21-
version = "0.7.7"
20+
repository = "https://github.com/supabase/storage-py"
21+
version = "0.7.7" # {x-release-please-version}
22+
2223

2324
[tool.poetry.dependencies]
2425
httpx = {version = ">=0.24,<0.28", extras = ["http2"]}
@@ -27,7 +28,6 @@ typing-extensions = "^4.2.0"
2728
python-dateutil = "^2.8.2"
2829

2930
[tool.poetry.dev-dependencies]
30-
python-semantic-release = "^9.8.6"
3131
black = "^24.8.0"
3232
isort = "^5.12.0"
3333
pre-commit = "^3.5.0"
@@ -42,16 +42,6 @@ unasync-cli = "^0.0.9"
4242
[tool.poetry.group.dev.dependencies]
4343
sphinx-toolbox = "^3.4.0"
4444

45-
[tool.semantic_release]
46-
version_variable = "storage3/utils.py:__version__"
47-
version_toml = ["pyproject.toml:tool.poetry.version"]
48-
major_on_zero = false
49-
commit_subject = "chore(release): bump version to v{version}"
50-
build_command = "curl -sSL https://install.python-poetry.org | python - --preview && export PATH=\"/github/home/.local/bin:$PATH\" && poetry install && poetry build"
51-
upload_to_vcs = true
52-
branch = "main"
53-
changelog_components = "semantic_release.changelog.changelog_headers,semantic_release.changelog.compare_url"
54-
5545
[tool.pytest.ini_options]
5646
asyncio_mode = "auto"
5747

release-please-config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"last-release-sha": "34fa0bbbeac64071dcc012afe671f5dd2e6f31c2",
3+
"packages": {
4+
".": {
5+
"changelog-path": "CHANGELOG.md",
6+
"release-type": "python"
7+
}
8+
}
9+
}

storage3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from storage3._async import AsyncStorageClient
88
from storage3._sync import SyncStorageClient
99
from storage3.constants import DEFAULT_TIMEOUT
10-
from storage3.utils import __version__
10+
from storage3.version import __version__
1111

1212
__all__ = ["create_client", "__version__"]
1313

storage3/_async/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from storage3.constants import DEFAULT_TIMEOUT
44

5-
from ..utils import AsyncClient, __version__
5+
from ..utils import AsyncClient
6+
from ..version import __version__
67
from .bucket import AsyncStorageBucketAPI
78
from .file_api import AsyncBucketProxy
89

storage3/_sync/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from storage3.constants import DEFAULT_TIMEOUT
44

5-
from ..utils import SyncClient, __version__
5+
from ..utils import SyncClient
6+
from ..version import __version__
67
from .bucket import SyncStorageBucketAPI
78
from .file_api import SyncBucketProxy
89

storage3/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from httpx import AsyncClient as AsyncClient # noqa: F401
22
from httpx import Client as BaseClient
33

4-
__version__ = "0.5.5"
5-
64

75
class SyncClient(BaseClient):
86
def aclose(self) -> None:

0 commit comments

Comments
 (0)