Skip to content

Commit

Permalink
Test publishing on TestPyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiX committed Aug 27, 2023
1 parent 9e05fae commit 5f73d62
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/test.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Tests (tox)
name: CI

on:
- push
- pull_request

env:
DEFAULT_PYTHON: '3.11'

jobs:
build:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -25,11 +28,11 @@ jobs:
- name: Test with tox
run: tox
if: ${{ matrix.python-version != '3.11' }}
if: ${{ matrix.python-version != env.DEFAULT_PYTHON }}

- name: Test with tox (and upload coverage)
uses: paambaati/[email protected]
if: ${{ matrix.python-version == '3.11' }}
if: ${{ matrix.python-version == env.DEFAULT_PYTHON }}
env:
CC_TEST_REPORTER_ID: 2a411f596959fc32f5d73f3ba7cef8cc4d5733299d742dbfc97fd6c190b9010c
with:
Expand All @@ -41,3 +44,31 @@ jobs:
- uses: codecov/codecov-action@v3
with:
directory: '.tox/reports'

publish:
needs: [tests]
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '${{ env.DEFAULT_PYTHON }}'

- name: Build
run: |
# Cheat
sed '/\[tool.setuptools_scm\]/ s/$/\nlocal_scheme = "no-local-version"/' pyproject.toml
pip install build
python3 -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

0 comments on commit 5f73d62

Please sign in to comment.