-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (63 loc) · 2.12 KB
/
Copy pathpython-publish.yaml
File metadata and controls
82 lines (63 loc) · 2.12 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
name: 'Python Publish'
on:
workflow_call:
inputs:
PYTHON_PROJECT_NAME:
description: PyPi Package Project
required: true
type: string
PYTHON_PROJECT_URL:
description: PyPi Package Project
default: pypi.org # pypi.org | test.pypi.org
required: false
type: string
# secrets:
# password:
# required: true
jobs:
pypi-publish:
name: Upload release to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://${{ inputs.PYTHON_PROJECT_URL}}/p/${{ inputs.PYTHON_PROJECT_NAME}}/
permissions:
id-token: write
steps:
- name: Download built artifact to dist/
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1
with:
name: Packages
path: dist
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# skip-existing: true
# repository-url: https://${{ inputs.PYTHON_PROJECT_URL}}/project/${{ inputs.PYTHON_PROJECT_NAME}}/
# user: ${{ secrets.NFC_PYPI_USERNAME }}
# password: ${{ secrets.NFC_PYPI_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.13'
- name: Install Twine
run: |
pip install twine
- name: Trace
run: |
ls -l;
echo '****************************************************';
ls -l dist/;
- name: Publish package distributions to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.NFC_PYPI_TOKEN }}
# TWINE_REPOSITORY: https://${{ inputs.PYTHON_PROJECT_URL}}/project/${{ inputs.PYTHON_PROJECT_NAME}}/
run: |
twine upload \
--verbose \
--username __token__ \
--password ${{ secrets.NFC_PYPI_TOKEN }} \
dist/*