Skip to content

release: bump 0.2.0 → 0.3.0 + CHANGELOG for 19 post-0.2.0 phases #2

release: bump 0.2.0 → 0.3.0 + CHANGELOG for 19 post-0.2.0 phases

release: bump 0.2.0 → 0.3.0 + CHANGELOG for 19 post-0.2.0 phases #2

Workflow file for this run

name: release
# Triggered by pushing a tag matching v*. Builds the Python wheel + sdist
# and publishes to PyPI, and builds the Docker image and pushes to GHCR
# under the same version tag.
#
# Required repository secrets (configure in Settings → Secrets):
# PYPI_API_TOKEN — PyPI project-scoped token (https://pypi.org/manage/account/token/)
# Required permissions:
# contents: read
# packages: write (for ghcr.io)
# (The GITHUB_TOKEN is auto-provided.)
on:
push:
tags:
- 'v*'
jobs:
pypi:
name: build + publish to PyPI
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build deps
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build wheel + sdist
run: python -m build
- name: Twine check
run: twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
if [ -z "$TWINE_PASSWORD" ]; then
echo "PYPI_API_TOKEN not set — skipping publish (artifact built only)."
exit 0
fi
twine upload dist/*
docker:
name: build + push docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build + push (multi-arch)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/zhub:latest
ghcr.io/${{ github.repository_owner }}/zhub:${{ steps.ver.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max