-
Notifications
You must be signed in to change notification settings - Fork 16
54 lines (51 loc) · 1.51 KB
/
python-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
50
51
52
53
name: Upload Python Package
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*'
jobs:
release:
name: Create Release
runs-on: windows-2019
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: softprops/action-gh-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 }}
name: Release ${{ github.ref }}
body_path: CHANGELOG.md
draft: false
prerelease: false
build-n-publish:
name: Build and publish to PyPI
needs: release
runs-on: windows-2019
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
if (Test-Path requirements.txt) { pip install -r requirements.txt }
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build binary wheel and source tarball
run: |
python -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*