Skip to content

Commit

Permalink
Add deployment to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor committed Oct 15, 2022
1 parent 0e7b2f1 commit 690a756
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ jobs:
- name: Upload source distribution
uses: actions/upload-artifact@v3
with:
name: sdist
path: "dist/*.tar.gz"
if-no-files-found: error
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheel
path: "dist/*.whl"
name: build-output
path: "dist/*"
if-no-files-found: error

test:
Expand Down Expand Up @@ -74,7 +68,7 @@ jobs:
- name: Download wheel
uses: actions/download-artifact@v3
with:
name: wheel
name: build-output
path: dist/

- name: Install wheel
Expand All @@ -85,3 +79,33 @@ jobs:
- name: Test with pytest
run: |
pytest
deploy:
runs-on: ubuntu-latest
needs: [build, test]

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: build-output
path: dist/

- name: Deploy to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/head/master')
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: dist/*

- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/v')
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 690a756

Please sign in to comment.