Add support for in-url params. #37
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: Upload Package to Pypi and TestPyPI | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dist-requirements.txt | |
- name: Create Environment Variable For Test PyPI Builds | |
if: startsWith(github.ref, 'refs/tags/') != true | |
shell: bash | |
run: | | |
echo 'SCM_NO_LOCAL_SCHEME=true' >> $GITHUB_ENV | |
- name: Check environment variable | |
run: echo "${{ env.SCM_NO_LOCAL_SCHEME}}" | |
- name: Build package | |
run: tox -ebuild | |
- name: Publish to Test PyPI | |
if: startsWith(github.ref, 'refs/tags/') != true | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |