From bcd1fed65ce665222a585ec0ef4f72ad8a7d550f Mon Sep 17 00:00:00 2001 From: hhpatel14 Date: Wed, 5 Feb 2025 12:39:38 -0500 Subject: [PATCH] test publish --- .github/workflows/ci.yml | 27 ++++++++++++++++++++++----- .gitignore | 2 ++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36446d06..4d9d35e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: npm run compile publish: - name: Fake Publish in Fork (Real in Main) + name: Package & Upload VSIX (Fake Publish in Fork, Real in Main) runs-on: ubuntu-latest needs: test # Ensure tests pass before publishing if: github.event_name == 'release' # Ensure it only runs on a new release @@ -48,7 +48,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v4 with: - node-version: "16" + node-version: "21" - name: Install vsce (VS Code Extension Manager) run: npm install -g @vscode/vsce @@ -59,14 +59,31 @@ jobs: - name: Build Extension run: npm run compile # Change if needed - # Step 5: Fake Publish on Fork, Real Publish on Main + # Step 5: Package the VSIX file and ensure "dist" directory exists + - name: Package the VSIX file + run: | + mkdir -p dist # Create the dist folder if it doesn't exist + vsce package -o dist/extension.vsix # Generate the VSIX file in "dist/" + + # Step 6: Debugging Step - List dist directory + - name: Debug: List dist directory + run: ls -la dist/ + + # Step 7: Upload VSIX file as an artifact + - name: Upload VSIX Artifact + uses: actions/upload-artifact@v4 + with: + name: vscode-extension + path: dist/*.vsix + + # Step 8: Fake Publish on Fork, Real Publish on Main - name: Fake Publish (If Fork) or Real Publish env: - IS_FORK: ${{ github.repository_owner != 'hhpatel14' }} + IS_FORK: ${{ github.repository_owner == 'hhpatel14' }} run: | + echo "Checking if this is a fork..." if [ "$IS_FORK" = "true" ]; then echo "This is a fork. Running fake publish..." - vsce package else echo "This is the main repo. Publishing to VS Code Marketplace..." vsce publish --pat ${{ secrets.VSCE_TOKEN }} diff --git a/.gitignore b/.gitignore index f20eac51..ac3cc8ea 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ node_modules/ data/ out/ build/ +dist/ +*.vsix \ No newline at end of file