-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (44 loc) · 1.29 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
48
49
name: 'Publish'
on:
release:
types:
- published
workflow_dispatch:
inputs:
tag:
required: true
type: string
description: Tag name to release
jobs:
publish:
name: 'Publish to PyPI'
runs-on: ubuntu-latest
environment:
name: production
url: https://pypi.org/p/fingerprint-pro-server-api-sdk
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
if: github.event_name == 'release'
with:
ref: ${{ github.event.release.tag_name }}
- name: 'Checkout repository'
uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
ref: ${{ github.event.inputs.tag }}
- name: 'Install Python'
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: 'Build'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install wheel
pip install twine
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@897895f1e160c830e369f9779632ebc134688e1b