Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
tags: v*

jobs:
release:
runs-on: ubuntu-latest
environment: pypi
# Using OIDC/Trusted Publisher: https://docs.pypi.org/trusted-publishers/using-a-publisher/
permissions:
id-token: write
steps:
- uses: actions/checkout@v6

- name: Build distribution
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or would we rather use a build artifact, eg via calling the build.yml workflow first, to consolidate build logic?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's not much duplication, so I think this is fine.

run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade build
python -m build

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.14
25 changes: 25 additions & 0 deletions release-process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Cutting a new release of the Spin Python SDK

To cut a new release, you will need to do the following:

1. Confirm that [CI is green](https://github.com/spinframework/spin-python-sdk/actions) for the commit selected to be tagged and released.

1. If not already bumped, set the intended release version in [pyproject.toml](./pyproject.toml), create a pull request with these changes and merge once approved.

1. Checkout the commit with the version bump from above.

1. Create and push a new tag with a `v` and then the version number.

As an example, via the `git` CLI:

```
# Create a GPG-signed and annotated tag
git tag -s -m "Spin Python SDK v4.1.0" v4.1.0

# Push the tag to the remote corresponding to spinframework/spin-python-sdk (here 'origin')
git push origin v4.1.0
```

1. Pushing the tag upstream will trigger the [release action](https://github.com/spinframework/spin-python-sdk/actions/workflows/release.yml) which publishes the distribution to pypi.org

1. If applicable, create PR(s) or coordinate [documentation](https://github.com/spinframework/spin-docs) needs, e.g. for new features or updated functionality.
Loading