v0.2.0 #26
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: | |
- '*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # need tags to generate release notes | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Install package | |
run: | | |
poetry install | |
- name: Run tests | |
run: | | |
poetry run pytest -v | |
- name: Build wheel | |
id: build | |
run: | | |
poetry build | |
echo "py_wheel_name=investments-${GITHUB_REF#refs/tags/}-py3-none-any.whl" >> $GITHUB_OUTPUT | |
- name: Generate Release Notes | |
run: | | |
echo '## Changes since previous release:' > changelog.md | |
git log --oneline $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- [%h](https://github.com/cdump/investments/commit/%H) %s" >> changelog.md | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
body_path: changelog.md | |
files: | | |
dist/${{ steps.build.outputs.py_wheel_name }} | |
- name: Publish | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
poetry publish |