fix: Update CI/CD workflow for improved artifact handling#8
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves the CI/CD workflow for VS Code extension publishing by implementing proper artifact handling between build and deploy jobs. The changes separate the build and deployment concerns, ensuring the VSIX package created during build is properly transferred to the deployment job.
Key changes:
- Added artifact upload step in the build job to store the generated VSIX file
- Modified the deploy job to download the artifact instead of attempting to upload it
- Enhanced the deployment script with better error handling and updated to use the maintained
@vscode/vscepackage
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # For example, using vsce to publish the extension | ||
| npx vsce publish --pat ${{ secrets.VSCE_PAT }} No newline at end of file | ||
| # Publish pre-built VSIX using the maintained @vscode/vsce package | ||
| FILE=$(ls -1 *.vsix | head -n 1) |
There was a problem hiding this comment.
This command will fail if no VSIX files are found, causing the deployment to fail silently. Add a check to ensure at least one VSIX file exists before attempting to list them, or use a more robust file selection method.
| FILE=$(ls -1 *.vsix | head -n 1) | |
| FILE=$(ls -1 *.vsix 2>/dev/null | head -n 1) | |
| if [ -z "$FILE" ]; then | |
| echo "Error: No VSIX files found to publish." >&2 | |
| exit 1 | |
| fi |
| if [ -z "${VSCE_PAT}" ]; then | ||
| echo "VSCE_PAT secret is not set" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
[nitpick] The VSCE_PAT validation is redundant since the secret is already referenced in the env block at line 70. GitHub Actions will automatically handle missing secrets, and this check adds unnecessary complexity to the deployment script.
| if [ -z "${VSCE_PAT}" ]; then | |
| echo "VSCE_PAT secret is not set" >&2 | |
| exit 1 | |
| fi |
No description provided.