Skip to content

Commit ae16dfb

Browse files
authored
Merge pull request #203 from authzed/get-automatic-version-bumping-working
Get automatic version bumping working
2 parents a5e4e3a + ee846f1 commit ae16dfb

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

.github/workflows/automatic-api-update.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ jobs:
2222
UPDATED_STATUS: "${{ steps.buf-update.outputs.updated }}"
2323
run: |
2424
echo "Update status: $UPDATED_STATUS"
25-
- name: "Update package version"
26-
uses: "authzed/actions/semver-update@main"
27-
if: "steps.buf-update.outputs.updated == 'true'"
28-
with:
29-
sourcefile-path: "pyproject.toml"
30-
version-regex: 'name = "authzed"\nversion = "(.+)"'
31-
version-change: "minor"
3225
- name: "Install buf"
3326
uses: "bufbuild/[email protected]"
3427
with:

.github/workflows/manual-api-update.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ jobs:
2626
UPDATED_STATUS: "${{ steps.buf-update.outputs.updated }}"
2727
run: |
2828
echo "Update status: $UPDATED_STATUS"
29-
- name: "Update package version"
30-
uses: "authzed/actions/semver-update@main"
31-
if: "steps.buf-update.outputs.updated == 'true'"
32-
with:
33-
sourcefile-path: "pyproject.toml"
34-
version-regex: 'name = "authzed"\nversion = "(.+)"'
35-
version-change: "minor"
3629
- name: "Install buf"
3730
uses: "bufbuild/[email protected]"
3831
with:
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
---
22
name: "Publish to PyPI"
3-
on: "push"
3+
on:
4+
release:
5+
types:
6+
- "published"
47
jobs:
58
publish:
69
name: "Build & Publish"
710
runs-on: "ubuntu-latest"
811
steps:
912
- uses: "actions/checkout@v4"
13+
- name: "Install Poetry"
14+
uses: "snok/install-poetry@v1"
1015
- uses: "actions/setup-python@v5"
1116
with:
1217
python-version: "3.11"
13-
- name: "Install pypa/build"
14-
run: "python -m pip install build --user"
18+
cache: 'poetry'
19+
# This gives us a version number without the release prefix
20+
- name: "Write release version"
21+
run: |
22+
VERSION=${GITHUB_REF_NAME#v}
23+
echo Version: $VERSION
24+
echo "VERSION=$VERSION" >> $GITHUB_ENV
25+
- name: "Set the release number in pyproject.toml"
26+
run: "poetry version -s $VERSION"
1527
- name: "Build wheel and source tarball"
16-
run: "python -m build --sdist --wheel --outdir dist/ ."
28+
run: "poetry build"
1729
- name: "Publish"
18-
if: "startsWith(github.ref, 'refs/tags')"
1930
uses: "pypa/gh-action-pypi-publish@release/v1"
2031
with:
2132
password: "${{ secrets.PYPI_API_TOKEN }}"

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
authors = ["Authzed <[email protected]>"]
33
description = "Client library for SpiceDB."
44

5-
# NOTE: These two lines must be kept together for the API update action to function
65
name = "authzed"
7-
version = "0.18.1"
6+
# The version is set at publish time with a call to `poetry version -s <tag>`,
7+
# where the tag comes from the release.
8+
version = "0.0.0"
89
packages = [
910
{include = "authzed"},
1011
{include = "validate"},

0 commit comments

Comments
 (0)