-
Notifications
You must be signed in to change notification settings - Fork 1
184 lines (155 loc) · 4.64 KB
/
Copy pathrelease.yml
File metadata and controls
184 lines (155 loc) · 4.64 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Release Pipeline
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g. v0.1.3)'
required: true
type: string
jobs:
resolve:
name: Resolve version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
version_number: ${{ steps.resolve.outputs.version_number }}
steps:
- name: Resolve version from tag or input
id: resolve
run: |
if [ -n "${{ inputs.version }}" ]; then
TAG="${{ inputs.version }}"
else
TAG="${GITHUB_REF#refs/tags/}"
fi
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "version_number=${TAG#v}" >> $GITHUB_OUTPUT
echo "Releasing: $TAG"
pypi:
name: Deploy to PyPI
needs: resolve
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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 packages
run: |
uv build --package pararam-nexus-mcp
uv build --package pararam-nexus-channel
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ needs.resolve.outputs.version_number }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
docker:
name: Deploy Docker Images
needs: resolve
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- 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 }}
- 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.resolve.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.resolve.outputs.version_number }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: Create GitHub Release
needs: [resolve, pypi, docker]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- 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 packages
run: |
uv build --package pararam-nexus-mcp
uv build --package pararam-nexus-channel
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ needs.resolve.outputs.version_number }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.resolve.outputs.version }}
name: Release ${{ needs.resolve.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: |
dist/*.whl
dist/*.tar.gz
body: |
## Release ${{ needs.resolve.outputs.version }}
### Installation
```bash
# MCP server (using uvx)
uvx pararam-nexus-mcp
# Channel server (using uvx)
uvx pararam-nexus-channel
# Or install with uv
uv tool install pararam-nexus-mcp
uv tool install pararam-nexus-channel
# Or with pip
pip install pararam-nexus-mcp
pip install pararam-nexus-channel
```
#### Docker (MCP server)
```bash
docker pull ivolnistov/pararam-nexus-mcp:${{ needs.resolve.outputs.version_number }}
docker pull ghcr.io/${{ github.repository }}:${{ needs.resolve.outputs.version_number }}
```
### What's Changed
See the full changelog below.