[Enh] Version now specified in spm/_version.py #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create tag from new version | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: | |
- main | |
paths: | |
- spm/_version.py | |
permissions: | |
contents: write | |
jobs: | |
setup-tag: | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Check out SPM Python | |
uses: actions/checkout@v4 | |
- name: Get package version | |
run: | | |
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' spm/_version.py) | |
echo "pyproject.toml version: $VERSION" | |
git config user.name github-actions | |
git config user.email [email protected] | |
MSG=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline) | |
echo "Creating tag $VERSION with message:" | |
echo "$MSG" | |
git tag -a "$VERSION" -m "$MSG" | |
- name: Publish tags | |
run: git push --tags |