From 22c695cfb2f1cbd4b5494eee33286a9d939cf5af Mon Sep 17 00:00:00 2001 From: jbirddog Date: Fri, 17 Apr 2026 14:56:38 +0000 Subject: [PATCH 1/4] CI job to publish alpha build on merge to main --- .github/workflows/publish-alpha.yml | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/publish-alpha.yml diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml new file mode 100644 index 00000000..da5c8fca --- /dev/null +++ b/.github/workflows/publish-alpha.yml @@ -0,0 +1,60 @@ +name: Publish Alpha to PyPI 📦 + +on: + push: + branches: + - main + +jobs: + publish-alpha: + name: Build and publish alpha release to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Generate alpha version + id: version + run: | + # Extract current version from version.py + CURRENT_VERSION=$(grep -oP "__version__ = '\K[0-9.]+(?=')" SpiffWorkflow/version.py) + + # Split version into major.minor.patch + MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1) + MINOR=$(echo $CURRENT_VERSION | cut -d. -f2) + PATCH=$(echo $CURRENT_VERSION | cut -d. -f3) + + # Increment patch version + NEXT_PATCH=$((PATCH + 1)) + + # Get short git SHA + GIT_SHA=$(git rev-parse --short HEAD) + + # Generate alpha version: major.minor.(patch+1).alpha+gitsha + ALPHA_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}.alpha${GIT_SHA}" + + echo "alpha_version=${ALPHA_VERSION}" >> $GITHUB_OUTPUT + echo "Generated alpha version: ${ALPHA_VERSION}" + + - name: Update version.py with alpha version + run: | + echo "__version__ = '${{ steps.version.outputs.alpha_version }}'" > SpiffWorkflow/version.py + cat SpiffWorkflow/version.py + + - name: Install pypa/build + run: python -m pip install build --user + + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + username: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 1bb4726678866f6b8e8e8a27b6d61067d7470789 Mon Sep 17 00:00:00 2001 From: jbirddog Date: Fri, 17 Apr 2026 14:58:22 +0000 Subject: [PATCH 2/4] Sanity test --- .github/workflows/publish-alpha.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index da5c8fca..55760d1b 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - wf jobs: publish-alpha: From 46736a742dba030fbfde4367c91c218b97728745 Mon Sep 17 00:00:00 2001 From: jbirddog Date: Fri, 17 Apr 2026 15:01:04 +0000 Subject: [PATCH 3/4] New releaes name format --- .github/workflows/publish-alpha.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 55760d1b..d485eafa 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -34,11 +34,11 @@ jobs: # Increment patch version NEXT_PATCH=$((PATCH + 1)) - # Get short git SHA - GIT_SHA=$(git rev-parse --short HEAD) + # Get timestamp for unique alpha version + TIMESTAMP=$(date +%s) - # Generate alpha version: major.minor.(patch+1).alpha+gitsha - ALPHA_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}.alpha${GIT_SHA}" + # Generate alpha version: major.minor.(patch+1)a (PEP 440 compliant, PyPI compatible) + ALPHA_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}a${TIMESTAMP}" echo "alpha_version=${ALPHA_VERSION}" >> $GITHUB_OUTPUT echo "Generated alpha version: ${ALPHA_VERSION}" From d4418995d550b0d81da58693613b1b8ae152c8b0 Mon Sep 17 00:00:00 2001 From: jbirddog Date: Fri, 17 Apr 2026 15:02:57 +0000 Subject: [PATCH 4/4] Only deploy on push to main --- .github/workflows/publish-alpha.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index d485eafa..c39f517d 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - wf jobs: publish-alpha: