diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8875ced..9e853aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,22 @@ env: # complains about missing BLAS. CIBW_SKIP: "*musllinux* pp310*" jobs: + build_sdist: + name: Build sdist + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.12" + - name: Install build + run: python -m pip install build==1.0.3 + - name: Build sdist + run: python -m build --sdist + - uses: actions/upload-artifact@v3 + with: + path: ./dist/*.tar.gz + build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/DEV.md b/DEV.md index b7d846a..5bac590 100644 --- a/DEV.md +++ b/DEV.md @@ -15,10 +15,11 @@ lefthook install pipenv install --dev ``` -## Building +## Local Build This section explains how to build -[a wheel](https://realpython.com/python-wheels/) of this package. +[a wheel](https://realpython.com/python-wheels/) of this package on your local +machine. 1. Run @@ -28,19 +29,15 @@ python -m build --wheel This builds a wheel file and saves it in `dist/`. -## How to Upload to PyPI +## Build, Release & Publish -1. [Run `build_ext`](https://stackoverflow.com/a/4515279/915552) +This section explains how to create a release (build sdist and wheel files of a +version) and publish to GitHub and PyPI. - python setup.py build_ext - -2. [Build a wheel](https://packaging.python.org/guides/distributing-packages-using-setuptools/#pure-python-wheels) - - python setup.py sdist - -3. [Upload](https://packaging.python.org/guides/distributing-packages-using-setuptools/#uploading-your-project-to-pypi) - - twine upload dist/pycodec2.*tar.gz +1. Run the build GitHub action. +2. Fetch the built artifacts and unpack. +3. Run `twine upload ARTIFACTS`. +4. Run `gh release create VERSION`. ## ADRs