Feature: Add details RateLimitException to parse x-ratelimit header (… #44
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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: | |
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: PyPI | |
on: | |
workflow_dispatch: ~ | |
release: | |
types: [published] | |
push: | |
tags: | |
- '*.*.*' | |
env: | |
DEFAULT_PYTHON: "3.10" | |
jobs: | |
pypi: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Set version variable | |
id: version | |
run: | | |
if [[ "${GITHUB_REF#refs/heads/}" = "${GITHUB_REF}" ]]; then | |
APP_VERSION=${GITHUB_REF#refs/tags/} | |
else | |
git fetch --tags --unshallow | |
version=$(git describe --tags --abbrev=0) | |
subver=${{ github.run_number }} | |
APP_VERSION=$version.post$subver | |
fi | |
echo "version=$APP_VERSION" >> $GITHUB_OUTPUT | |
- name: Install dependencies and build | |
env: | |
APP_VERSION: ${{ steps.version.outputs.version }} | |
run: | | |
# Setup version | |
set -x | |
echo "__version__ = '$APP_VERSION'" > trakt/__version__.py | |
cat trakt/__version__.py | |
python -c "from trakt import __version__; print(__version__)" | |
# Build the package | |
python -m pip install --upgrade build | |
python -m build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
# vim:ts=2:sw=2:et |