Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch: {}

permissions:
contents: read
contents: write
packages: write

jobs:
Expand All @@ -34,10 +34,26 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine tag name
id: tag
- name: Resolve release version and image repository
id: version
run: |
echo "ref_name=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
CRATE_VERSION=$(sed -nE 's/^version = "([^"]+)"/\1/p' Cargo.toml | head -n1)
if [ -z "${CRATE_VERSION}" ]; then
echo "::error::Could not determine crate version from Cargo.toml"
exit 1
fi

RELEASE_TAG="v${CRATE_VERSION}"
IMAGE_REPO="ghcr.io/${GITHUB_REPOSITORY,,}"

echo "crate_version=${CRATE_VERSION}" >> "$GITHUB_OUTPUT"
echo "release_tag=${RELEASE_TAG}" >> "$GITHUB_OUTPUT"
echo "image_repo=${IMAGE_REPO}" >> "$GITHUB_OUTPUT"

if [ "${GITHUB_REF_TYPE}" = "tag" ] && [ "${GITHUB_REF_NAME}" != "${RELEASE_TAG}" ]; then
echo "::error::Tag ${GITHUB_REF_NAME} does not match Cargo.toml version ${CRATE_VERSION} (expected ${RELEASE_TAG})"
exit 1
fi

- name: Build and push multi-arch Docker image
uses: docker/build-push-action@v6
Expand All @@ -47,16 +63,18 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/rust-cargo-docs-rag-mcp:${{ steps.tag.outputs.ref_name }}
ghcr.io/${{ github.repository_owner }}/rust-cargo-docs-rag-mcp:latest
${{ steps.version.outputs.image_repo }}:${{ steps.version.outputs.release_tag }}
${{ steps.version.outputs.image_repo }}:${{ steps.version.outputs.crate_version }}
${{ steps.version.outputs.image_repo }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Create GitHub release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.ref_name }}
tag_name: ${{ steps.version.outputs.release_tag }}
target_commitish: ${{ github.sha }}
Comment on lines 72 to +77
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the workflow derives release_tag (and can run via workflow_dispatch), the later asset-upload steps should explicitly target the same tag. Currently those steps use softprops/action-gh-release without tag_name, which defaults to github.ref and can attach assets to the wrong release (or fail) when not running on a tag ref. Consider passing tag_name: ${{ steps.version.outputs.release_tag }} to the upload steps (or using the create_release step outputs) to keep all release operations aligned.

Copilot uses AI. Check for mistakes.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-cargo-docs-rag-mcp"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
description = "Rust Documentation MCP Server for LLM crate assistance"
authors = ["Brian Horakh <brianh@promptexecution.com>",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ Repository requirements:

Prebuilt images are published to GitHub Container Registry (GHCR) on release tags.

Pull the image (replace OWNER with the GH org or username that owns the repo; tags look like v0.3.0):
Pull the image (replace OWNER with the GH org or username that owns the repo; tags look like v0.3.1):
```bash
docker pull ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:latest
# or a specific version:
docker pull ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:v0.3.0
docker pull ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:v0.3.1
```

Run the container in HTTP mode (default):
Expand Down
2 changes: 1 addition & 1 deletion cog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pre_bump_hooks = [
]

post_bump_hooks = [
"git add Cargo.toml Cargo.lock CHANGELOG.md"
"git add Cargo.toml Cargo.lock server.json CHANGELOG.md"
]

[[packages]]
Expand Down
18 changes: 18 additions & 0 deletions scripts/set-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,21 @@ if not updated:

path.write_text("\n".join(out_lines) + "\n")
PY

# Update server.json version and OCI package tag
python3 - "$version" <<'PY'
import json, pathlib, sys
version = sys.argv[1]
path = pathlib.Path("server.json")
data = json.loads(path.read_text())
data["version"] = version

for pkg in data.get("packages", []):
if pkg.get("registryType") != "oci":
continue
ident = pkg.get("identifier")
if isinstance(ident, str) and ":" in ident:
pkg["identifier"] = f"{ident.rsplit(':', 1)[0]}:{version}"

path.write_text(json.dumps(data, indent=2) + "\n")
PY
4 changes: 2 additions & 2 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"url": "https://github.com/promptexecution/rust-cargo-docs-rag-mcp",
"source": "github"
},
"version": "0.3.0",
"version": "0.3.1",
"packages": [
{
"registryType": "oci",
"identifier": "ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:0.3.0",
"identifier": "ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:0.3.1",
"runtimeHint": "docker",
"transport": {
"type": "stdio"
Expand Down