-
Notifications
You must be signed in to change notification settings - Fork 21
57 lines (54 loc) · 1.69 KB
/
releases.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
54
55
56
57
name: Upload Python Package
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Any release (0.5.3)
- '[0-9]+.[0-9]+.[0-9]+.[ab][0-9]+' # Any pre-release (0.7.0.a12)
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Generate change log
id: change_log
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
${{ steps.change_log.outputs.changelog }}
draft: false
prerelease: ${{ contains(github.ref, 'a') || contains(github.ref, 'b') }}
deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
python -m pip install --upgrade build
- name: Build Distribution
run: |
python -m build
python -m twine check dist/*
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}