Skip to content

standardize GET query handling #50

standardize GET query handling

standardize GET query handling #50

Workflow file for this run

name: Publish to PyPI
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# Controls when the workflow will run
on:
# Triggers the workflow on push for the "main" branch
push:
branches: [ "main" ]
jobs:
pypi-publish:
name: Upload release to PyPI
if: github.repository == 'prelectai/toadr3'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: 😎 Checkout
uses: actions/checkout@main
- name: 🐍 Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: 🦀 Install dependencies
run: |
pip install poetry
poetry install
- name: πŸ¦‘ Fetch package version
run: |
echo "CURRENT_VERSION=v$(poetry version --short)" >> $GITHUB_ENV
echo "Version = v$(poetry version --short)"
- name: πŸ— Build package
run: poetry build
- name: πŸ“° Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Check if the version is a pre-release by looking for the presence of 'a', 'b', or 'rc' in the version number.
- name: 🏷️ Create release (or pre-release)
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
run: |
if [[ "${{ env.CURRENT_VERSION }}" == "*(a|b|rc)*" ]]; then
echo "Creating pre-release ${{ env.CURRENT_VERSION }}"
gh release create --prerelease ${{ env.CURRENT_VERSION }} dist/*
else
echo "Creating release ${{ env.CURRENT_VERSION }}"
gh release create ${{ env.CURRENT_VERSION }} dist/*
fi