Derive the package version from git tags via setuptools_scm
This commit is contained in:
@@ -57,24 +57,20 @@ jobs:
|
||||
wheel:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Full history: setuptools_scm derives the package version from the
|
||||
# release tag (v1.1.0-alpha.16 -> 1.1.0a16), so the wheel is
|
||||
# version-locked to the binaries of the same release.
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: build the scimesh wheel
|
||||
env:
|
||||
VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
# The tag (v1.1.0-alpha.10) becomes the package version in its
|
||||
# PEP 440 form (1.1.0a10); the wheel is then version-locked to the
|
||||
# binaries of the same release.
|
||||
WHEEL_VERSION="${VERSION#v}"
|
||||
WHEEL_VERSION="${WHEEL_VERSION/-alpha./a}"
|
||||
WHEEL_VERSION="${WHEEL_VERSION/-beta./b}"
|
||||
WHEEL_VERSION="${WHEEL_VERSION/-rc./rc}"
|
||||
sed -i "s/^version = .*/version = \"${WHEEL_VERSION}\"/" pyproject.toml
|
||||
python -m pip install --quiet build
|
||||
python -m build --wheel --outdir dist
|
||||
ls -la dist/
|
||||
|
||||
Reference in New Issue
Block a user