Skip to content

Commit 1e9f447

Browse files
authored
Create deploy.yml
1 parent 8e20078 commit 1e9f447

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'test_deploy'
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build-n-publish:
13+
name: Build and publish Python 🐍 distributions 📦 to PyPI
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
19+
- name: Set up Python 3.10
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.10
23+
24+
- name: Install pypa/build
25+
run: >-
26+
python -m
27+
pip install
28+
build
29+
--user
30+
31+
- name: Build a binary wheel and a source tarball
32+
run: >-
33+
python -m
34+
build
35+
--sdist
36+
--wheel
37+
--outdir dist/
38+
.
39+
40+
- name: Publish distribution 📦 to Test PyPI
41+
uses: pypa/gh-action-pypi-publish@master
42+
with:
43+
skip_existing: true
44+
password: ${{ secrets.test_pypi_password }}
45+
repository_url: https://test.pypi.org/legacy/
46+
47+
- name: Publish distribution 📦 to PyPI
48+
if: startsWith(github.ref, 'refs/tags')
49+
uses: pypa/gh-action-pypi-publish@master
50+
with:
51+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)