Skip to content

v0.8.0

v0.8.0 #5

Workflow file for this run

name: Publish
on:
release:
types: [published]
permissions:
contents: write
packages: write
jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for changelog generation
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Verify version matches tag
run: |
VERSION=$(poetry version -s)
TAG=${GITHUB_REF#refs/tags/v}
if [ "$VERSION" != "$TAG" ]; then
echo "Version mismatch: $VERSION != $TAG"
exit 1
fi
- name: Build package
run: poetry build
- name: Check dist contents
run: |
ls -l dist/
if [ ! -f "dist/commitloom-"*".tar.gz" ] || [ ! -f "dist/commitloom-"*".whl" ]; then
echo "Missing distribution files"
exit 1
fi
- name: Extract changelog entry
id: changelog
run: |
VERSION=$(poetry version -s)
CHANGELOG_ENTRY=$(awk -v ver="$VERSION" '
BEGIN { found=0; entry="" }
$0 ~ "^## \\[" ver "\\]" { found=1; next }
found && /^## / { exit }
found { entry = entry $0 "\n" }
END { print entry }
' CHANGELOG.md)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG_ENTRY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
- name: Update GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl
dist/*.tar.gz
body: |
${{ steps.changelog.outputs.changelog }}
## Installation
```bash
pip install commitloom==${{ steps.version.outputs.version }}
```
## Documentation
For full documentation, visit: https://github.com/akkarinc/commitloom
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}