Skip to content

Commit f90967b

Browse files
authored
Merge pull request #144 from ocefpaf/publish_to_pypi
Publish to pypi
2 parents 9434053 + cd17167 commit f90967b

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/pypi.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
release:
9+
types:
10+
- published
11+
12+
jobs:
13+
packages:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.x"
22+
23+
- name: Get tags
24+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
25+
shell: bash
26+
27+
- name: Install build tools
28+
run: |
29+
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
30+
31+
shell: bash
32+
33+
- name: Build binary wheel
34+
run: python -m build --sdist --wheel . --outdir dist
35+
36+
- name: CheckFiles
37+
run: |
38+
ls dist
39+
shell: bash
40+
41+
- name: Test wheels
42+
run: |
43+
cd dist && python -m pip install ctd*.whl
44+
python -m twine check *
45+
shell: bash
46+
47+
- name: Publish a Python distribution to PyPI
48+
if: success() && github.event_name == 'release'
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
user: __token__
52+
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)