docs: fix rst changelog #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Validate version | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
VERSION=$(poetry version -s) | |
if [ "v$VERSION" != "$TAG_NAME" ]; then | |
echo "Version mismatch: v$VERSION != $TAG_NAME" | |
exit 1 | |
fi | |
release: | |
needs: validate | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction --without dev,ml | |
- name: Update Changelog | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
python scripts/changelog.py $TAG_NAME | |
- name: Build package | |
run: poetry build | |
- name: Publsh to PyPI | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
run: poetry publish | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: CHANGELOG.md | |
draft: false | |
prerelease: false | |
files: | | |
dist/*.whl | |
dist/*.tar.gz |