Skip to content

Commit 502707f

Browse files
committed
test publish
1 parent 86708e2 commit 502707f

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

.github/workflows/ci.yml

+14-27
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,39 @@ name: Basic CI
33
on:
44
push:
55
branches:
6-
- "master" # Trigger only on pushes to the master branch
6+
- "master"
77
pull_request:
88
branches:
9-
- "master" # Trigger on pull requests targeting the master branch
9+
- "master"
1010
release:
1111
types:
12-
- created # Run when a new release is created
12+
- created
1313

1414
jobs:
1515
test:
1616
name: Run Tests
17-
runs-on: ubuntu-latest # Use Ubuntu for the runner
17+
runs-on: ubuntu-latest
1818

1919
steps:
20-
# Step 1: Checkout the code
2120
- name: Checkout code
2221
uses: actions/checkout@v4
2322

24-
# Step 2: Set up Node.js
2523
- name: Setup Node.js
2624
uses: actions/setup-node@v4
2725
with:
28-
node-version: "16" # Specify the Node.js version
26+
node-version: "16"
2927

30-
# Step 3: Install dependencies
3128
- name: Install dependencies
3229
run: npm install
3330

34-
# Step 4: Compile the project
3531
- name: Compile the project
36-
run: npm run compile
32+
run: npm run compile
3733

3834
publish:
3935
name: Package & Upload VSIX (Fake Publish in Fork, Real in Main)
4036
runs-on: ubuntu-latest
41-
needs: test # Ensure tests pass before publishing
42-
if: github.event_name == 'release' # Ensure it only runs on a new release
37+
needs: test
38+
if: github.event_name == 'release'
4339

4440
steps:
4541
- name: Checkout Repository
@@ -57,32 +53,23 @@ jobs:
5753
run: npm install
5854

5955
- name: Build Extension
60-
run: npm run compile # Change if needed
56+
run: npm run compile
6157

62-
# Step 5: Package the VSIX file and ensure "dist" directory exists
63-
- name: Package the VSIX file
64-
run: |
65-
mkdir -p dist # Create the dist folder if it doesn't exist
66-
vsce package -o dist/extension.vsix # Generate the VSIX file in "dist/"
58+
- name: Ensure dist directory exists
59+
run: mkdir -p dist
6760

68-
# Step 6: Debugging Step - List dist directory
69-
- name: Debug: List dist directory
70-
run: ls -la dist/
61+
- name: Package the VSIX file
62+
run: vsce package -o dist/extension.vsix
7163

72-
# Step 7: Upload VSIX file as an artifact
7364
- name: Upload VSIX Artifact
7465
uses: actions/upload-artifact@v4
7566
with:
7667
name: vscode-extension
7768
path: dist/*.vsix
7869

79-
# Step 8: Fake Publish on Fork, Real Publish on Main
8070
- name: Fake Publish (If Fork) or Real Publish
81-
env:
82-
IS_FORK: ${{ github.repository_owner == 'hhpatel14' }}
8371
run: |
84-
echo "Checking if this is a fork..."
85-
if [ "$IS_FORK" = "true" ]; then
72+
if [ "${{ github.repository_owner }}" = "hhpatel14" ]; then
8673
echo "This is a fork. Running fake publish..."
8774
else
8875
echo "This is the main repo. Publishing to VS Code Marketplace..."

0 commit comments

Comments
 (0)