Skip to content

0.2.0

0.2.0 #5

name: publish
on:
release:
types: [published]
branches:
- main
jobs:
publish:
name: Publish 🚀
runs-on: ubuntu-latest
env:
VERSION: null
steps:
- uses: actions/checkout@v4
- name: Set up uv 🐍
uses: astral-sh/setup-uv@v5
- name: Get version
run: |
grep "__version__ = " src/reproj/__init__.py | awk '{print "VERSION="$(NF)}' | tr -d \" >> $GITHUB_ENV
- name: Build a binary wheel and a source tarball 🚧
run: uv build
- name: Validate release tag
run: |
if [ "${GITHUB_REF#refs/tags/}" != "${VERSION}" ]; then exit 1; fi
- name: Publish to Test PyPI 📦
if: contains(env.VERSION, 'a')
uses: pypa/[email protected]
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI 📦
if: |
!contains(env.VERSION, 'a')
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}