-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (43 loc) · 1.17 KB
/
upload-to-pypi.yml
File metadata and controls
52 lines (43 loc) · 1.17 KB
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
48
49
50
51
52
name: Upload to PyPI
on:
workflow_run:
workflows: ["Release Drafter"]
types:
- completed
permissions:
contents: write
jobs:
upload_to_pypi:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
tags: true
ref: main
- name: Get Latest Tag
id: get_version
run: |
VERSION=$(git describe --tags --abbrev=0)
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
- name: Update __init__.py with Version
run: |
echo "__version__ = '${VERSION}'" > red_plex/__init__.py
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}