Skip to content

Commit 6815d85

Browse files
Fix: Update GitHub Actions workflow with correct environment variables and artifact upload paths (#38)
1 parent 4e41a7c commit 6815d85

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

.github/workflows/release-dev.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,25 @@ jobs:
5151
if: steps.webview-cache.outputs.cache-hit != 'true'
5252
run: cd webview-ui && npm ci
5353

54-
- name: Build Extension
55-
run: npm run build
56-
5754
- name: Build package
5855
run: |
59-
echo "PACKAGE_NAME=$(node -p "require('./package.json').name || 'hai-build-code-generator'")" >> $GITHUB_ENV
60-
echo "BUILD_VERSION=$(node -p "require('./package.json').version || '0.0.0'")" >> $GITHUB_ENV
56+
# Set the package name and version from package.json or use default values
57+
PACKAGE_NAME="$(node -p "require('./package.json').name || 'hai-build-code-generator'")"
58+
BUILD_VERSION="$(node -p "require('./package.json').version || '0.0.0'")"
59+
60+
# Save the environment variables to GitHub Actions environment
61+
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
62+
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV
63+
64+
# Build the VSIX package
65+
echo "Output Package Name: $PACKAGE_NAME-$BUILD_VERSION.vsix"
6166
npx @vscode/vsce package --out "$PACKAGE_NAME-$BUILD_VERSION.vsix"
6267
6368
- name: Upload artifact
6469
uses: actions/upload-artifact@v4
6570
with:
66-
name: vsix-package
67-
path: ${{ github.workspace }}/${{ env.PACKAGE_NAME }}-${{ env.BUILD_VERSION }}.vsix
71+
name: "${{ env.PACKAGE_NAME }}-${{ env.BUILD_VERSION }}"
72+
path: "${{ env.PACKAGE_NAME }}-${{ env.BUILD_VERSION }}.vsix"
6873
retention-days: 90
6974

7075
- name: Notify release
@@ -134,7 +139,7 @@ jobs:
134139
},
135140
{
136141
\"type\": \"TextBlock\",
137-
\"text\": \"Release - v${{ needs.initialize.outputs.package_name }}:${{ needs.initialize.outputs.build_version }}\",
142+
\"text\": \"Release - v${{ env.BUILD_VERSION }}\",
138143
\"weight\": \"Bolder\",
139144
\"size\": \"Medium\"
140145
},
@@ -143,11 +148,6 @@ jobs:
143148
\"text\": \"🎉 The latest release is now available!\",
144149
\"wrap\": true
145150
},
146-
{
147-
\"type\": \"TextBlock\",
148-
\"text\": \"Download the artifact from: $ARTIFACT_URL\",
149-
\"wrap\": true
150-
},
151151
{
152152
\"type\": \"Image\",
153153
\"url\": \"$RANDOM_GIF\",

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ jobs:
5252
if: steps.webview-cache.outputs.cache-hit != 'true'
5353
run: cd webview-ui && npm ci
5454

55-
- name: Build Extension
56-
run: npm run build
57-
5855
- name: Install Publishing Tools
5956
run: npm install -g vsce
6057

0 commit comments

Comments
 (0)