-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (51 loc) · 1.85 KB
/
pypi.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
50
51
52
53
name: Deploy to PyPI
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
name: "Deploy to PyPI"
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Autoadd release Tags
uses: sbrodehl/action-autotag@v2
id: autotag
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
source_file: "src/miniflask/__init__.py"
extraction_regex: "__version__\\s*=\\s*[\\'\"]((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?:[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)[\\'\"]"
capture_group: 1
tag_message: "Release"
tag_format: "v{version}"
- name: Create Release
if: steps.autotag.outputs.tagsha
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.autotag.outputs.tagname }}
name: "Miniflask ${{ steps.autotag.outputs.tagname }}"
generate_release_notes: true
- name: Show version
if: steps.autotag.outputs.tagsha
run: echo ${{ steps.autotg.outputs.tagsha }}
- name: Set up Python
if: steps.autotag.outputs.tagsha
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
if: steps.autotag.outputs.tagsha
run: python setup.py sdist
- name: Publish a Python distribution to PyPI
if: steps.autotag.outputs.tagsha
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
# Guide: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions