Skip to content

Commit

Permalink
Use pypa/gh-action-pypi-publish for publishing to pypi.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillahoffmann committed Jan 6, 2023
1 parent a982980 commit 82c67b1
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
test-component:
component:
- arangodb
- azurite
- clickhouse
Expand Down Expand Up @@ -98,26 +98,29 @@ jobs:
run: flake8
- name: Run tests
run: >
pytest -svx --cov-report=term-missing --cov=testcontainers.${{ matrix.test-component }}
--tb=short ${{ matrix.test-component }}/tests
pytest -svx --cov-report=term-missing --cov=testcontainers.${{ matrix.component }}
--tb=short ${{ matrix.component }}/tests
- name: Build the package
working-directory: ${{ matrix.test-component }}
working-directory: ${{ matrix.component }}
run: |
python setup.py bdist_wheel
twine check dist/*
- name: Publish the package to test pypi
if: matrix.python-version == '3.10'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: twine upload --repository testpypi ${{ matrix.test-component }}/dist/*
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
packages_dir: ${{ matrix.component }}/dist
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish the package to pypi
if: >
github.event_name == 'push'
&& github.ref == 'refs/heads/master'
&& github.repository_owner == 'testcontainers'
&& matrix.python-version == '3.10'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload ${{ matrix.test-component }}/dist/*
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: ${{ matrix.component }}/dist
skip_existing: true

0 comments on commit 82c67b1

Please sign in to comment.