From 6815d85288f680cd517b8d625ab108754938a9c0 Mon Sep 17 00:00:00 2001 From: Karthick-Elumalai Date: Thu, 30 Jan 2025 21:46:09 +0530 Subject: [PATCH] Fix: Update GitHub Actions workflow with correct environment variables and artifact upload paths (#38) --- .github/workflows/release-dev.yml | 26 +++++++++++++------------- .github/workflows/release.yml | 3 --- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 10510cb..ef0a31b 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -51,20 +51,25 @@ jobs: if: steps.webview-cache.outputs.cache-hit != 'true' run: cd webview-ui && npm ci - - name: Build Extension - run: npm run build - - name: Build package run: | - echo "PACKAGE_NAME=$(node -p "require('./package.json').name || 'hai-build-code-generator'")" >> $GITHUB_ENV - echo "BUILD_VERSION=$(node -p "require('./package.json').version || '0.0.0'")" >> $GITHUB_ENV + # Set the package name and version from package.json or use default values + PACKAGE_NAME="$(node -p "require('./package.json').name || 'hai-build-code-generator'")" + BUILD_VERSION="$(node -p "require('./package.json').version || '0.0.0'")" + + # Save the environment variables to GitHub Actions environment + echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV + echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV + + # Build the VSIX package + echo "Output Package Name: $PACKAGE_NAME-$BUILD_VERSION.vsix" npx @vscode/vsce package --out "$PACKAGE_NAME-$BUILD_VERSION.vsix" - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: vsix-package - path: ${{ github.workspace }}/${{ env.PACKAGE_NAME }}-${{ env.BUILD_VERSION }}.vsix + name: "${{ env.PACKAGE_NAME }}-${{ env.BUILD_VERSION }}" + path: "${{ env.PACKAGE_NAME }}-${{ env.BUILD_VERSION }}.vsix" retention-days: 90 - name: Notify release @@ -134,7 +139,7 @@ jobs: }, { \"type\": \"TextBlock\", - \"text\": \"Release - v${{ needs.initialize.outputs.package_name }}:${{ needs.initialize.outputs.build_version }}\", + \"text\": \"Release - v${{ env.BUILD_VERSION }}\", \"weight\": \"Bolder\", \"size\": \"Medium\" }, @@ -143,11 +148,6 @@ jobs: \"text\": \"🎉 The latest release is now available!\", \"wrap\": true }, - { - \"type\": \"TextBlock\", - \"text\": \"Download the artifact from: $ARTIFACT_URL\", - \"wrap\": true - }, { \"type\": \"Image\", \"url\": \"$RANDOM_GIF\", diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8066984..4ed522a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,9 +52,6 @@ jobs: if: steps.webview-cache.outputs.cache-hit != 'true' run: cd webview-ui && npm ci - - name: Build Extension - run: npm run build - - name: Install Publishing Tools run: npm install -g vsce