diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9af9d7e..9ec00a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies run: | python3 -m pip install --upgrade pip - python3 -m pip install setuptools wheel twine + python3 -m pip install setuptools wheel twine build pip install -r requirements.txt pip install pytest - name: Test with pytest @@ -24,8 +24,7 @@ jobs: - name: Build and publish to TestPyPI run: | # Install the package from setup.py - python3 setup.py install - python3 setup.py sdist bdist_wheel + python3 -m build python3 -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* env: TWINE_USERNAME: __token__ diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 42ab4eb..17ce346 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,4 +1,4 @@ -name: Lint and Test +name: Test on: [push] jobs: lint: @@ -34,3 +34,16 @@ jobs: - name: Test with pytest run: | pytest tests -v + + - name: Install build + run: | + pip install build + pip install twine + - name: Build and publish to TestPyPI + run: | + # Install the package from setup.py + python3 -m build + python3 -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* --verbose + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_TEST_TOKEN }}