Skip to content
Open
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
10 changes: 7 additions & 3 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ jobs:
run: |
mkdir -p "${RELEASE_DIR}"

# Read base version from VERSION file at the root
BASE_VERSION=$(cat ../VERSION)

# Generate version suffix
TIMESTAMP=$(date +'%Y%m%d-%H%M')
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_SUFFIX="-${TIMESTAMP}-${SHORT_SHA}"
FULL_VERSION="${BASE_VERSION}-${TIMESTAMP}-${SHORT_SHA}"
echo "FULL_VERSION=${FULL_VERSION}" >> $GITHUB_ENV

command_exp='.mcpServers."devops-mcp".command = "${extensionPath}${/}'
command_exp="${command_exp}${BIN_FILE}\""
command_exp="${command_exp} | .version += \"${VERSION_SUFFIX}\""
command_exp="${command_exp} | .version = \"${FULL_VERSION}\""
jq "${command_exp}" < ../gemini-extension.json >"${RELEASE_DIR}/gemini-extension.json"

cp ../README.md "${RELEASE_DIR}/"
Expand All @@ -107,7 +111,7 @@ jobs:
export GOARCH=${{ matrix.platform.goarch }}

output_path="${RELEASE_DIR}/${{ matrix.platform.bin_file }}"
go build -o "${output_path}"
go build -ldflags "-X main.version=${{ env.FULL_VERSION }}" -o "${output_path}"

- name: Create release assets
id: archive
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,16 @@ jobs:
run: |
mkdir -p "${RELEASE_DIR}"

# Extract version from tag (v1.2.3 -> 1.2.3)
VERSION="${TAG_NAME#v}"
# Prioritize TAG based versioning if it matches v[0-9].[0-9].[0-9]
if [[ "${TAG_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="${TAG_NAME#v}"
echo "Using version from tag: ${VERSION}"
else
VERSION=$(cat ../VERSION)
echo "Using version from VERSION file: ${VERSION}"
fi

echo "VERSION=${VERSION}" >> $GITHUB_ENV

command_exp='.mcpServers."devops-mcp".command = "${extensionPath}${/}'
command_exp="${command_exp}${BIN_FILE}\""
Expand All @@ -107,7 +115,7 @@ jobs:
export GOARCH=${{ matrix.platform.goarch }}

output_path="${RELEASE_DIR}/${{ matrix.platform.bin_file }}"
go build -o "${output_path}"
go build -ldflags "-X main.version=${{ env.VERSION }}" -o "${output_path}"

- name: Create release assets
id: archive
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.1
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,18 @@ build_mcp() {
err "Error: MCP serverdirectory '${MCP_SERVER_DIR}' not found."
return 1
fi

# Read version from root VERSION file and validate it
VERSION=$(cat VERSION | xargs)
if [[ -z "${VERSION}" ]]; then
err "Error: VERSION file is empty or contains only whitespace."
return 1
fi
(
cd ${MCP_SERVER_DIR}
go mod tidy
go build -o "../${BINARY_NAME}"
echo "Successfully built '${BINARY_NAME}' Please move it to `.gemini/extensions/devops/bin/devops-mcp-server`"
go build -ldflags "-X main.version=${VERSION}" -o "../${BINARY_NAME}"
echo "Successfully built '${BINARY_NAME}' version ${VERSION}. Please move it to `.gemini/extensions/devops/bin/devops-mcp-server`"
)
}

Expand Down
3 changes: 1 addition & 2 deletions devops-mcp-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ import (
"github.com/modelcontextprotocol/go-sdk/mcp"
)

//go:embed version.txt
var version string
var version = "0.1.0-dev"

func createServer() *mcp.Server {
opts := &mcp.ServerOptions{
Expand Down
1 change: 0 additions & 1 deletion devops-mcp-server/version.txt

This file was deleted.

2 changes: 1 addition & 1 deletion gemini-extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devops",
"version": "0.1.1",
"version": "0.1.0-dev",
"description": "The DevOps extension provides Gemini powered AI assisted CI/CD. It supports deployment to Cloud Run and Cloud Storage as well as creation of a robust CI/CD pipeline.",
"mcpServers": {
"devops-mcp": {
Expand Down
Loading