Implementation:0xSteph Pentest ai Release Workflow
| Knowledge Sources | |
|---|---|
| Domains | CI_CD, Release_Management, PyPI |
| Last Updated | 2026-10-23 00:00 GMT |
Overview
Concrete tool for building, testing, and publishing pentest-ai to PyPI via GitHub Actions, triggered by version tags.
Description
The release.yml GitHub Actions workflow automates the release pipeline. It triggers on version tags (e.g. v0.10.3), runs the full test suite with a pytest result guard against os._exit truncation, verifies the tag matches pyproject.toml version, builds sdist + wheel, runs twine check, and publishes to PyPI using Trusted Publishing (OIDC) with a fallback to API token. It uses pinned action versions with commit SHAs for supply-chain security.
Usage
This workflow runs automatically when a version tag is pushed. To cut a release: bump version in pyproject.toml and CHANGELOG.md, commit, then git tag v0.10.3 && git push --tags.
Code Reference
Source Location
- Repository: 0xSteph_Pentest_ai
- File: .github/workflows/release.yml
- Lines: 1-354
Signature
name: Release to PyPI
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
tag:
description: "Version tag to release (e.g. v0.10.3)"
required: true
permissions:
contents: read
id-token: write
jobs:
test: # Run pytest + result guard
build: # Build sdist + wheel, twine check
publish: # Upload to PyPI via Trusted Publishing
Import
# No import — this is a GitHub Actions workflow file.
# Place at .github/workflows/release.yml in the repository.
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| tag | git tag (v*.*.*) | Yes | Version tag matching pyproject.toml version |
| PYPI_API_TOKEN | secret | No | Fallback if Trusted Publishing not configured |
Outputs
| Name | Type | Description |
|---|---|---|
| PyPI package | sdist + wheel | Published to pypi.org/project/ptai |
| GitHub Release | artifact | dist/ uploaded as build artifact |
Usage Examples
Cut a Release
# 1. Bump version in pyproject.toml and CHANGELOG.md
# 2. Commit
git commit -am "release: v1.2.3"
# 3. Tag and push
git tag v1.2.3
git push --tags
# The workflow automatically:
# - runs tests with result guard
# - verifies tag == pyproject version
# - builds sdist + wheel
# - twine checks dist/*
# - publishes to PyPI