Skip to content

Commit 8fff4ea

Browse files
authored
fix: update Go version (#123)
1 parent b376105 commit 8fff4ea

File tree

4 files changed

+129
-7
lines changed

4 files changed

+129
-7
lines changed

.github/workflows/nightly-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
archive_cmd: 'cd "${RELEASE_DIR}" && zip -r "${ARCHIVE_PATH}" .',
6969
}
7070
steps:
71-
- uses: actions/checkout@v4
71+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
7272
with:
7373
# Do not checkout 'main'. Checkout the exact SHA prep-release used.
7474
ref: ${{ needs.prep-release.outputs.release_sha }}
@@ -95,7 +95,7 @@ jobs:
9595
- name: Set up Go
9696
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
9797
with:
98-
go-version: "1.24.8"
98+
go-version: "~1.25.5"
9999

100100
- name: Download Dependencies
101101
run: go mod tidy
@@ -128,7 +128,7 @@ jobs:
128128
needs: [build-release]
129129
runs-on: ubuntu-latest
130130
steps:
131-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
131+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
132132

133133
- name: Download all archives from artifacts
134134
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: NPM Publish Nightly
16+
17+
on:
18+
workflow_dispatch: # Manual trigger
19+
inputs:
20+
npm_token:
21+
description: 'NPM Token for publishing (optional, falls back to secret)'
22+
required: false
23+
type: string
24+
workflow_run:
25+
workflows: ["Nightly Release"]
26+
types: [completed]
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
publish-npm:
33+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
40+
with:
41+
node-version: '24'
42+
registry-url: 'https://registry.npmjs.org'
43+
44+
- name: Check NPM Token
45+
env:
46+
TOKEN: ${{ inputs.npm_token || secrets.NPM_TOKEN }}
47+
run: |
48+
if [ -z "$TOKEN" ]; then
49+
echo "Error: NPM_TOKEN is not set in inputs or secrets. Exiting."
50+
exit 1
51+
fi
52+
53+
- name: Download Nightly Release Assets
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: |
57+
mkdir -p artifacts
58+
gh release download nightly --pattern '*' --dir artifacts --repo ${{ github.repository }}
59+
60+
- name: List downloaded files
61+
run: ls -R artifacts
62+
63+
- name: Extract Binaries
64+
run: |
65+
mkdir -p cicd-mcp-server/npm/cicd-mcp-linux-amd64/bin
66+
mkdir -p cicd-mcp-server/npm/cicd-mcp-darwin-arm64/bin
67+
mkdir -p cicd-mcp-server/npm/cicd-mcp-windows-amd64/bin
68+
69+
# Extract Linux
70+
tar -xzvf artifacts/linux.x64.cicd.tar.gz -C cicd-mcp-server/npm/cicd-mcp-linux-amd64/bin cicd-mcp-server
71+
72+
# Extract Darwin
73+
tar -xzvf artifacts/darwin.arm64.cicd.tar.gz -C cicd-mcp-server/npm/cicd-mcp-darwin-arm64/bin cicd-mcp-server
74+
75+
# Extract Windows
76+
unzip artifacts/win32.x64.cicd.zip -d cicd-mcp-server/npm/cicd-mcp-windows-amd64/bin cicd-mcp-server.exe
77+
78+
- name: Set Nightly Version
79+
id: version
80+
run: |
81+
# Get current version from meta package
82+
cd cicd-mcp-server/npm/cicd-mcp
83+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
84+
85+
# Create nightly version
86+
NIGHTLY_VERSION="${PACKAGE_VERSION}-nightly.$(date +%Y%m%d%H%M)"
87+
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT
88+
89+
cd ../../..
90+
91+
# Update sub-packages
92+
for dir in cicd-mcp-linux-amd64 cicd-mcp-darwin-arm64 cicd-mcp-windows-amd64; do
93+
cd cicd-mcp-server/npm/$dir
94+
npm version $NIGHTLY_VERSION --no-git-tag-version
95+
cd ../../..
96+
done
97+
98+
# Update meta package
99+
cd cicd-mcp-server/npm/cicd-mcp
100+
npm version $NIGHTLY_VERSION --no-git-tag-version
101+
102+
# Update optionalDependencies in meta package
103+
jq ".optionalDependencies[\"@google-cloud/cicd-mcp-linux-amd64\"] = \"$NIGHTLY_VERSION\" | .optionalDependencies[\"@google-cloud/cicd-mcp-darwin-arm64\"] = \"$NIGHTLY_VERSION\" | .optionalDependencies[\"@google-cloud/cicd-mcp-windows-amd64\"] = \"$NIGHTLY_VERSION\"" package.json > package.json.tmp && mv package.json.tmp package.json
104+
105+
cd ../../..
106+
107+
- name: Publish Sub-packages
108+
env:
109+
NODE_AUTH_TOKEN: ${{ inputs.npm_token || secrets.NPM_TOKEN }}
110+
run: |
111+
for dir in cicd-mcp-linux-amd64 cicd-mcp-darwin-arm64 cicd-mcp-windows-amd64; do
112+
cd cicd-mcp-server/npm/$dir
113+
npm publish --tag nightly --access public
114+
cd ../../..
115+
done
116+
117+
- name: Publish Meta Package
118+
env:
119+
NODE_AUTH_TOKEN: ${{ inputs.npm_token || secrets.NPM_TOKEN }}
120+
run: |
121+
cd cicd-mcp-server/npm/cicd-mcp
122+
npm publish --tag nightly --access public

.github/workflows/prep-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
sha: ${{ steps.get_sha.outputs.sha }}
4040

4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
4343
with:
4444
ref: main
4545

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
archive_cmd: 'cd "${RELEASE_DIR}" && zip -r "${ARCHIVE_PATH}" .',
6969
}
7070
steps:
71-
- uses: actions/checkout@v4
71+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
7272
with:
7373
# Do not checkout 'main'. Checkout the exact SHA prep-release used.
7474
ref: ${{ needs.prep-release.outputs.release_sha }}
@@ -95,7 +95,7 @@ jobs:
9595
- name: Set up Go
9696
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
9797
with:
98-
go-version: "1.24.8"
98+
go-version: "~1.25.5"
9999

100100
- name: Download Dependencies
101101
run: go mod tidy
@@ -128,7 +128,7 @@ jobs:
128128
needs: [build-release]
129129
runs-on: ubuntu-latest
130130
steps:
131-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
131+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
132132

133133
- name: Download all archives from artifacts
134134
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5

0 commit comments

Comments
 (0)