Closed tkittel closed 6 months ago
Saving WIP (unfinished!) workflow stuff here:
name: add-version-tag
on:
push:
branches:
- main
paths:
- src/_simple_build_system/data/version.txt
jobs:
add_vtag:
runs-on: ubuntu-latest
#permissions:
# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout
uses: actions/checkout@v4
#Note: We get all history and tags, to be sure we do not miss anything:
with:
fetch-depth: 0
- name: Update tag
run: |
set -eux
test -f src/_simple_build_system/data/version.txt
export NEWVTAG="v$(cat src/_simple_build_system/data/version.txt)"
if [ $(git tag -l "$NEWVTAG") ]; then echo "ERROR: Tag already exists: '$NEWTAGVAL'"; false; fi
Also add the version.txt file of course (also to MANIFEST.in)
The ideas in the previous comments are valid, but will probably not be needed for this project. Closing.
Perhaps init.py (or a version.txt) file next to it could have a tag description embedded, like here:
https://git-scm.com/docs/gitattributes
That would provide versioning even for the case where a downloaded archive is pip install'ed.
However, this does not actually change the package meta data, so is not a complete solution.