Skip to content

Commit

Permalink
Merge pull request #33 from csdev/gha-release
Browse files Browse the repository at this point in the history
ci: add pypi release step
  • Loading branch information
csdev committed Apr 20, 2023
2 parents 771ee4f + 62dcc8a commit 863fa12
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -13,6 +13,7 @@ jobs:
# https://github.com/tox-dev/tox-gh/tree/1.0.0
test:
name: test ${{ matrix.py }} - ${{ matrix.os }}
timeout-minutes: 10
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
Expand All @@ -35,3 +36,40 @@ jobs:
run: tox r -vv --notest
- name: Run test suite
run: tox r --skip-pkg-install

# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 863fa12

Please sign in to comment.