47 lines (43 loc) · 1.22 KB
/
publish.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: Publish
on:
release:
types: [published]
permissions:
contents: read
jobs:
pypi:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ['3.11']
steps:
- name: Clone Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Dependencies
run: |
python -m pip install --upgrade pip
pip install build paramiko
- name: Build
run: python -m build --sdist --wheel .
- name: Publish to Test PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
print_hash: true
repository_url: https://test.pypi.org/legacy/
user: __token__
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true
user: __token__