Skip to content

Commit 7a9dcd5

Browse files
authored
Merge pull request #169 from MAIF/add_pypi_to_ci
👷 Add publish to pypi in CI
2 parents f4a4435 + 1b13165 commit 7a9dcd5

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

.github/workflows/main.yml

-15
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,3 @@ jobs:
4444
pip install tox tox-gh-actions
4545
- name: Test with tox
4646
run: tox
47-
48-
coverage:
49-
name: Create coverage badge
50-
needs: test
51-
runs-on: ubuntu-latest
52-
steps:
53-
- name: Coverage Badge
54-
uses: codecov/codecov-action@v3
55-
56-
deploy:
57-
name: Deploy python package
58-
needs: test
59-
runs-on: ubuntu-latest
60-
steps:
61-
- run: echo "Deploying .."

.github/workflows/publish.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to Pypi
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+" # regex to match semantic versioning tags
6+
7+
jobs:
8+
tests:
9+
uses: ./.github/workflows/main.yml
10+
publish:
11+
name: publish
12+
needs: [main] # require main to pass before publish runs
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout source
16+
uses: actions/checkout@v3
17+
- name: Set up Python 3.10
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.10
21+
- name: Build package
22+
run: |
23+
python -m pip install -U pip build
24+
python -m build
25+
- name: Publish
26+
uses: pypa/[email protected]
27+
with:
28+
user: __token__
29+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)