Skip to content

Nightly Release

Nightly Release #163

# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Nightly Release
on:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow
permissions:
contents: write
env:
RELEASE: nightly
jobs:
prep-release:
uses: ./.github/workflows/prep-release.yaml
with:
release: nightly
build-release:
needs: prep-release
runs-on: ubuntu-latest
defaults:
run:
working-directory: devops-mcp-server
env:
RELEASE_DIR: "${{ github.workspace }}/release"
DIST_DIR: "${{ github.workspace }}/dist"
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
strategy:
matrix:
platform:
- {
goos: "linux",
goarch: "amd64",
bin_file: "devops-mcp-server",
archive: "linux.x64.devops.tar.gz",
archive_cmd: 'tar -czvf "${ARCHIVE_PATH}" -C "${RELEASE_DIR}" .',
}
- {
goos: "darwin",
goarch: "arm64",
bin_file: "devops-mcp-server",
archive: "darwin.arm64.devops.tar.gz",
archive_cmd: 'tar -czvf "${ARCHIVE_PATH}" -C "${RELEASE_DIR}" .',
}
- {
goos: "windows",
goarch: "amd64",
bin_file: "devops-mcp-server.exe",
archive: "win32.x64.devops.zip",
archive_cmd: 'zip -j "${ARCHIVE_PATH}" "${RELEASE_DIR}"/*',
}
steps:
- uses: actions/checkout@v4
with:
# Do not checkout 'main'. Checkout the exact SHA prep-release used.
ref: ${{ needs.prep-release.outputs.release_sha }}
- name: prep-release
env:
BIN_FILE: "${{ matrix.platform.bin_file }}"
run: |
mkdir -p "${RELEASE_DIR}"
# Generate version suffix
TIMESTAMP=$(date +'%Y%m%d-%H%M')
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_SUFFIX="-${TIMESTAMP}-${SHORT_SHA}"
command_exp='.mcpServers."devops-mcp".command = "${extensionPath}${/}'
command_exp="${command_exp}${BIN_FILE}\""
command_exp="${command_exp} | .version += \"${VERSION_SUFFIX}\""
jq "${command_exp}" < ../gemini-extension.json >"${RELEASE_DIR}/gemini-extension.json"
cp ../README.md "${RELEASE_DIR}/"
cp -r ../commands "${RELEASE_DIR}/"
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
with:
go-version: "1.24.8"
- name: Download Dependencies
run: go mod tidy
- name: Build
run: |
export GOOS=${{ matrix.platform.goos }}
export GOARCH=${{ matrix.platform.goarch }}
output_path="${RELEASE_DIR}/${{ matrix.platform.bin_file }}"
go build -o "${output_path}"
- name: Create release assets
id: archive
run: |
mkdir -p "${DIST_DIR}"
echo "Creating ${{ matrix.platform.archive }}"
export ARCHIVE_PATH="${DIST_DIR}/${{ matrix.platform.archive }}"
sh -c "${{ matrix.platform.archive_cmd }}"
echo "Created ${ARCHIVE_PATH}"
echo "ARCHIVE_NAME=${{ matrix.platform.archive }}" >> "$GITHUB_OUTPUT"
- name: Upload archive as artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ steps.archive.outputs.ARCHIVE_NAME }}
path: ${{ github.workspace }}/dist/*
upload-assets:
needs: [build-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Download all archives from artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
path: artifacts
- name: List downloaded files
run: |
echo "--- Downloaded files ---"
ls -Rlrt artifacts/*
echo "------------------------"
- name: Upload release assets
id: upload-assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --clobber \
${{ env.RELEASE }} \
artifacts/*/*