Skip to content

Commit 81a6627

Browse files
authored
Create python-publish.yml
1 parent 2ee9406 commit 81a6627

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.x'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install build
29+
- name: Run tests
30+
run: |
31+
coverage run -m pytest
32+
env:
33+
SF_CONSUMER_KEY: ${{ secrets.SF_CONSUMER_KEY }}
34+
SF_PRIVATE_KEY: ${{ secrets.SF_PRIVATE_KEY }}
35+
SF_USERNAME: ${{ secrets.SF_USERNAME }}
36+
37+
38+
deploy:
39+
if: ${{ github.ref == 'refs/heads/master' }}
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Build package
43+
run: python -m build
44+
- name: Publish package
45+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
46+
with:
47+
user: __token__
48+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)