Repository navigation
140 lines (123 loc) · 5.14 KB
/
Copy pathnightly-release.yml
File metadata and controls
140 lines (123 loc) · 5.14 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
# 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: prep-release
env:
RAG_DB_PATH: "${RELEASE_DIR}/devops-rag.db"
BIN_FILE: "${{ matrix.platform.bin_file }}"
run: |
mkdir -p "${RELEASE_DIR}"
command_exp='.mcpServers."devops-mcp".command = "${extensionPath}${/}'
command_exp="${command_exp}${BIN_FILE}\""
jq "${command_exp}" < ../gemini-extension.json >"${RELEASE_DIR}/gemini-extension.json"
cp ../README.md "${RELEASE_DIR}/"
cp ../local-rag/devops-rag.db "${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/*/*