Skip to content

Commit ec21f7a

Browse files
committed
adapted git workflow
1 parent 6a02ef5 commit ec21f7a

1 file changed

Lines changed: 34 additions & 25 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
name: Upload Python Package
1+
name: Publish Python Package
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
tags:
6+
- 'v*' # This triggers the workflow only when a tag is pushed. Adjust according to your versioning scheme.
67

78
jobs:
8-
deploy:
9+
build:
910
runs-on: ubuntu-latest
11+
1012
steps:
11-
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
14-
with:
15-
python-version: '3.x'
16-
- name: Install dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
20-
- name: Build and publish
21-
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24-
run: |
25-
make release
26-
27-
- name: Publish Documentation
28-
run: |
29-
pip install -r requirements-docs.txt
30-
pip install -e .
31-
mkdocs gh-deploy --force
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: run tests
17+
run: |
18+
python tests.py
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install setuptools wheel twine
29+
30+
- name: Build package
31+
run: python setup.py sdist bdist_wheel
32+
33+
- name: Publish package to PyPI
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
37+
run: twine upload dist/*
38+
39+
- name: Clean up
40+
run: rm -rf dist build *.egg-info

0 commit comments

Comments
 (0)