Skip to content

Bump Version

Bump Version #3

Workflow file for this run

name: Bump Version & Release
on:
workflow_dispatch:
inputs:
bump:
description: 'Version bump type'
required: true
type: choice
options:
- patch
- minor
- major
jobs:
bump:
name: Bump version, build and release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write # For PyPI trusted publishing
outputs:
version: ${{ steps.next.outputs.version }}
version_number: ${{ steps.next.outputs.version_number }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to read all tags
- name: Get latest version tag
id: current
run: |
TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
echo "tag=${TAG:-v0.0.0}" >> $GITHUB_OUTPUT
echo "Current version: ${TAG:-v0.0.0}"
- name: Calculate next version
id: next
run: |
VERSION="${{ steps.current.outputs.tag }}"
VERSION="${VERSION#v}"
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
case "${{ inputs.bump }}" in
major) MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;;
minor) MINOR=$((MINOR + 1)); PATCH=0 ;;
patch) PATCH=$((PATCH + 1)) ;;
esac
NEXT="v${MAJOR}.${MINOR}.${PATCH}"
echo "version=$NEXT" >> $GITHUB_OUTPUT
echo "version_number=${MAJOR}.${MINOR}.${PATCH}" >> $GITHUB_OUTPUT
echo "Next version: $NEXT"
- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.next.outputs.version }}" -m "Release ${{ steps.next.outputs.version }}"
git push origin "${{ steps.next.outputs.version }}"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true # Don't block release if PyPI is not configured
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.next.outputs.version }}
name: Release ${{ steps.next.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: |
dist/*.whl
dist/*.tar.gz
body: |
## Release ${{ steps.next.outputs.version }}
### Installation
```bash
# Using uvx (no installation required)
uvx pararam-nexus-mcp
# Or install with uv
uv tool install pararam-nexus-mcp
# Or with pip
pip install pararam-nexus-mcp
```
### What's Changed
See the full changelog below.
docker:
name: Deploy Docker Images
needs: bump
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
continue-on-error: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/ivolnistov/pararam-nexus-mcp
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ needs.bump.outputs.version_number }}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SETUPTOOLS_SCM_PRETEND_VERSION=${{ needs.bump.outputs.version_number }}
cache-from: type=gha
cache-to: type=gha,mode=max