Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Nov 3, 2023
1 parent adc06cd commit e9cdb83
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name: Python tests
on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]

Expand Down Expand Up @@ -46,3 +48,36 @@ jobs:
- name: Test with pytest
run: |
pytest -v tests
- name: Build wheels
run: |
python setup.py sdist
- name: Upload wheels
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu'
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ tests ]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: '3.10'
miniforge-version: latest
miniforge-variant: Mambaforge
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade twine
twine upload --skip-existing *

0 comments on commit e9cdb83

Please sign in to comment.