Skip to content

Commit

Permalink
add: a GitHub actions workflow for the testPyPI upload
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnp committed Mar 18, 2023
1 parent 8a5e6c5 commit 55dabad
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build wheels and sdist and upload everything to testPyPI

on:
release:
types: [published]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PYSNDBXBNJMNP_ACCESS_TOKEN }}
repository_url: https://test.pypi.org/legacy/
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ dynamic = ["version"]
where = ["src"]

[tool.setuptools.dynamic]
version = {attr = "pysndbxbnjmnp.__version__"}
version = {attr = "pysndbxbnjmnp.__version__"}

# Limit the created wheels for windows to AMD64.
[tool.cibuildwheel.windows]
archs = ["AMD64"]

0 comments on commit 55dabad

Please sign in to comment.