-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.44 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 }}