Skip to content

v0.52.0: GitHub Action sticky PR-comment output (gate · annotate · co… #43

v0.52.0: GitHub Action sticky PR-comment output (gate · annotate · co…

v0.52.0: GitHub Action sticky PR-comment output (gate · annotate · co… #43

Workflow file for this run

name: Release
# Triggers on a pushed git tag matching `v*` (e.g. `v0.1.0`, `v1.0.0-rc1`).
# Builds the wheel + sdist, attests the build, and publishes to PyPI via
# PyPI's trusted publisher (OIDC) — no long-lived API token in repo secrets.
#
# To use this workflow you must first configure vstack as a trusted
# publisher on PyPI:
# https://docs.pypi.org/trusted-publishers/
#
# Once configured, cutting a release is:
#
# git tag v0.1.0
# git push origin v0.1.0
#
# The workflow does the rest.
on:
push:
tags:
- "v*"
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build wheel + sdist for release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- name: Verify tag matches pyproject version
id: version
run: |
set -e
TAG="${GITHUB_REF_NAME#v}"
PYPROJECT_VERSION=$(python -c "import tomllib, pathlib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")
echo "Tag version: $TAG"
echo "pyproject version: $PYPROJECT_VERSION"
if [ "$TAG" != "$PYPROJECT_VERSION" ]; then
echo "::error::tag $TAG does not match pyproject.toml version $PYPROJECT_VERSION"
exit 1
fi
echo "version=$TAG" >> "$GITHUB_OUTPUT"
- name: Install build
run: python -m pip install build
- name: Build wheel + sdist
run: python -m build
- name: Smoke-test wheel imports all 34 namespaces + surface modules
run: |
python -m pip install "dist/valanistack-${{ steps.version.outputs.version }}-py3-none-any.whl[mcp,api]"
python -c "
import importlib, vstack
assert vstack.__version__ == '${{ steps.version.outputs.version }}', f'version mismatch: {vstack.__version__}'
for ns in [
# 34 pattern namespaces
'vstack.aar', 'vstack.lencioni', 'vstack.trust_triangle',
'vstack.johari', 'vstack.grpi', 'vstack.bias_stack',
'vstack.psych_safety', 'vstack.thomas_kilmann',
'vstack.feedback_triggers', 'vstack.devils_advocate',
'vstack.lewin', 'vstack.mcallister_trust',
'vstack.social_loafing', 'vstack.debate_pathology',
'vstack.process_gain_loss', 'vstack.smart_goal',
'vstack.mcgregor', 'vstack.group_decision',
'vstack.schein_culture', 'vstack.grant_strengths',
'vstack.plus_delta', 'vstack.robbins_culture',
'vstack.superflocks', 'vstack.yerkes_dodson',
'vstack.org_structure', 'vstack.motivation_traps',
'vstack.glaser_conversation', 'vstack.goleman_ei',
'vstack.sdt_reward', 'vstack.span_of_control',
'vstack.danva_emotion', 'vstack.cognitive_reappraisal',
'vstack.hexaco', 'vstack.vroom_expectancy',
# surface modules added in v0.2.0 / v0.3.0
'vstack.mcp', 'vstack.memory', 'vstack.upgrade', 'vstack.api',
# surface modules added in v0.4.0
'vstack.adapters', 'vstack.learnings', 'vstack.analytics',
# surface modules added in v0.5.0
'vstack.browser', 'vstack.gbrain', 'vstack.benchmarks',
# surface modules added in v0.6.0
'vstack.security', 'vstack.cache', 'vstack.observability',
'vstack.doctor',
# surface modules added in v0.7.0
'vstack.hello',
]:
importlib.import_module(ns)
print('Release smoke test passed')
"
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: release-dist
path: dist/
retention-days: 30
publish-pypi:
name: Publish to PyPI (trusted publisher)
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/valanistack/${{ needs.build.outputs.version }}/
permissions:
id-token: write
steps:
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
name: release-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Create GitHub Release
needs: [build, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
name: release-dist
path: dist/
- name: Render release body
id: render
env:
VERSION: ${{ needs.build.outputs.version }}
run: |
python .github/render_release_notes.py \
--template .github/RELEASE_TEMPLATE.md \
--changelog CHANGELOG.md \
--version "$VERSION" \
--output release_body.md
{
echo "body<<RELEASE_EOF"
cat release_body.md
echo "RELEASE_EOF"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release with artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: vstack ${{ needs.build.outputs.version }}
body: ${{ steps.render.outputs.body }}
files: |
dist/valanistack-*.whl
dist/valanistack-*.tar.gz
draft: false
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}