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
41 changes: 41 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags:
- */v*

jobs:
repo_name:
name: Get repo name
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.split.outputs.repo_name }}
steps:
- name: Get repo name
# https://stackoverflow.com/questions/73402042/github-action-expressions-split-string
env:
TAG: ${{ github.ref_name }}
id: split
run: echo "repo_name=${TAG%%/*}"
release:
name: Release ${{ needs.repo_name.outputs.repo_name }}
runs-on: ubuntu-latest
needs: repo_name
environment:
name: pypi
url: https://pypi.org/p/${{ needs.repo_name.outputs.repo_name }}
permissions:
id-token: write
if: ${{ github.repository }} == 'stapi-spec/pystapi'
defaults:
run:
working-directory: ${{ needs.repo_name.outputs.repo_name }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install build
run: uv pip install build
- name: Build
run: uv run python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 16 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Releasing

1. Determine which package you're releasing
2. Determine the next version, following [semantic versioning](https://semver.org/)
3. Create a release branch: `git checkout -b release/{package}-v{version}`
4. Update that package's CHANGELOG with:
- A new header with the new version
- A new link at the bottom of the CHANGELOG for that header
5. `git push -u origin`
6. Once approved, merge the PR
7. `git checkout main && git pull && git tag {package}/v{version} && git push {package}/v{version}`
8. Github actions will automatically publish the release on tag push
9. Create a new [release](https://github.com/stapi-spec/pystapi/releases) pointing to the new tag

> [!NOTE]
> The tag format (`{package}/v{version}`) is very important, because that's how we discover which package to build and publish.
6 changes: 6 additions & 0 deletions stapi-pydantic/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.0.1] - 2025-04-01

Initial release.

[0.0.1]: https://github.com/stapi-spec/pystapi/releases/tag/v0.0.1