Skip to content

Commit

Permalink
Update CI and CD
Browse files Browse the repository at this point in the history
  • Loading branch information
regen100 committed Jan 8, 2023
1 parent 2a5983f commit 79d1983
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
38 changes: 21 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
name: Publish

on:
pull_request:
push:
tags:
- v*

jobs:
build-n-publish:
name: Build and publish
runs-on: ubuntu-18.04
publish:
name: Publish to PyPI
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install poetry
- name: Build a binary wheel and a source tarball
run: |
poetry build
- name: Publish distribution to PyPI
run: |
poetry publish -u __token__ -p ${{ secrets.pypi_password }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
- name: Build
run: |
pdm build
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
env:
os: ${{ matrix.os }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/build/
/dist/
__pycache__/

.tox/
Expand Down

0 comments on commit 79d1983

Please sign in to comment.