-
Notifications
You must be signed in to change notification settings - Fork 1
164 lines (138 loc) · 4.46 KB
/
Copy pathbump-version.yml
File metadata and controls
164 lines (138 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
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