Skip to content

Workflow file for this run

name: Release inventree-part-templates to PyPI based on a GitHub Release tag
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Build Wheel
run: |
pip install build
python -m build --wheel
- name: Publish to Test PyPI (for tags 'test-v*' or 'dev-v*')
if: |
startsWith(github.event.release.tag_name, 'test-v') ||
startsWith(github.event.release.tag_name, 'dev-v')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI (for tags v*, alpha-v*, beta-v*, rc-v*)
if: |
startsWith(github.event.release.tag_name, 'v') ||
startsWith(github.event.release.tag_name, 'alpha-v') ||
startsWith(github.event.release.tag_name, 'beta-v') ||
startsWith(github.event.release.tag_name, 'rcv-')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}