Skip to content

Commit 314261e

Browse files
data-douserCopilot
andauthored
Fix release.yml workflow for publishing CodeQL packs and npm package for codeql-development-mcp-server (#40)
* Initial plan * Enable auto-creation of tags in release workflow for workflow_dispatch Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * More fixes for release workflow --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 41b3a77 commit 314261e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
echo "version=${VERSION}" >> $GITHUB_OUTPUT
5959
echo "release_name=${VERSION#v}" >> $GITHUB_OUTPUT
6060
61-
- name: Release - Checkout tag for workflow_dispatch
61+
- name: Release - Checkout or create tag for workflow_dispatch
6262
if: github.event_name == 'workflow_dispatch'
6363
run: |
6464
# For workflow_dispatch, we need to checkout the specific tag
@@ -67,8 +67,11 @@ jobs:
6767
echo "Checking out existing tag: ${TAG}"
6868
git checkout "refs/tags/${TAG}"
6969
else
70-
echo "::error::Tag '${TAG}' does not exist. Create the tag first before running this workflow."
71-
exit 1
70+
echo "Tag '${TAG}' does not exist. Creating it now..."
71+
CURRENT_SHA=$(git rev-parse HEAD)
72+
git tag "${TAG}" "${CURRENT_SHA}"
73+
git push origin "${TAG}"
74+
echo "✅ Created and pushed tag: ${TAG} at commit ${CURRENT_SHA:0:8}"
7275
fi
7376
7477
- name: Release - Verify checkout matches expected version
@@ -99,6 +102,9 @@ jobs:
99102
add-to-path: true
100103
install-language-runtimes: false
101104

105+
- name: Release - Install CodeQL pack dependencies
106+
run: server/scripts/install-packs.sh
107+
102108
- name: Release - Publish CodeQL tool query packs
103109
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
104110
env:
@@ -137,9 +143,6 @@ jobs:
137143
cp -r server/ql dist-package/server/
138144
cp server/package.json dist-package/server/
139145
140-
# Copy root package-lock.json for npm ci (monorepo lockfile)
141-
cp package-lock.json dist-package/server/
142-
143146
# Copy root files
144147
cp README.md dist-package/
145148
cp LICENSE dist-package/
@@ -154,7 +157,7 @@ jobs:
154157
155158
- name: Release - Install production dependencies
156159
working-directory: dist-package/server
157-
run: npm ci --omit=dev --include=optional
160+
run: npm install --omit=dev --include=optional
158161

159162
- name: Release - Create archive
160163
run: |

0 commit comments

Comments
 (0)