Update version to 0.1.3 #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: Publish on PyPI | |
on: | |
push: | |
tags: | |
- v** | |
jobs: | |
check: | |
name: Verifying preconditions for releasing Tracely | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checking out sources | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Check _version.py was updated | |
env: | |
PYTHONPATH: ./tracely/src | |
run: |- | |
VERSION_TO_RELEASE=v$(python ./tracely/src/tracely/_version.py) | |
if [ "${{ github.ref_name }}" != "$VERSION_TO_RELEASE" ]; then | |
echo "Release triggered for tag ${{ github.ref_name }} but version.py contains $VERSION_TO_RELEASE" | |
exit 1 | |
fi | |
build: | |
name: Build distribution | |
runs-on: ubuntu-22.04 | |
needs: | |
- check | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install poetry | |
run: pip install poetry | |
- name: Build a binary wheel | |
run: poetry build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish_to_pypi: | |
name: Publish Python distributions to PyPI and TestPyPI | |
runs-on: [ubuntu-22.04] | |
needs: | |
- build | |
permissions: | |
id-token: write | |
environment: | |
name: Release | |
url: https://pypi.org/p/tracely | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
create_release: | |
name: Create release for the Tag | |
runs-on: [ubuntu-22.04] | |
needs: | |
- publish_to_pypi | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- id: create_release | |
name: Create Release for the Tag | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist/*" | |
generateReleaseNotes: true |