-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.28 KB
/
python-publish.yml
File metadata and controls
55 lines (44 loc) · 1.28 KB
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
# This workflow will build and upload the Python Package using Twine when a release is created
name: Release and Deploy Python Package
# When a tagged commit is pushed to master
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- uses: actions/cache@v2
with:
key: v0-${{ runner.os }}-pip-lint-${{ hashFiles('setup.cfg') }}
path: ~/.cache/pip
restore-keys: |
v0-${{ runner.os }}-pip-lint-
v0-${{ runner.os }}-pip-
- name: Install latest pip, setuptools, twine + wheel
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel
- name: Build wheels
run: |
python setup.py sdist bdist_wheel
- name: Publish package with twine
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --verbose dist/*
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
dist/*