Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/nightly-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
schedule:
- cron: "8 7 * * *" # 07:08 UTC daily
workflow_dispatch: {} # allow manual runs (no publish)
push:
tags:
- "v*"
- "*.*.*"

permissions:
contents: read
Expand All @@ -27,15 +31,18 @@ jobs:

- name: Compute nightly version from latest tag (per-second)
id: ver
if: github.ref_type != 'tag'
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 0.1.0)
BASE=${TAG#v}
DATE=$(date -u +%Y%m%d%H%M%S)
echo "NVER=${BASE}.dev${DATE}" >> $GITHUB_OUTPUT

- name: Build sdist/wheel with forced version
- name: Build sdist/wheel
run: |
export SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.ver.outputs.NVER }}
if [ "${GITHUB_REF_TYPE}" != "tag" ]; then
export SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.ver.outputs.NVER }}
fi
python -m build

- name: Check metadata
Expand All @@ -44,7 +51,7 @@ jobs:
twine check dist/*

- name: Publish to PyPI (API token)
if: github.event_name == 'schedule'
if: github.event_name == 'schedule' || github.ref_type == 'tag'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down