Skip to content

Commit f01e3b7

Browse files
committed
2 parents 0cb0724 + bf668c3 commit f01e3b7

4 files changed

Lines changed: 314 additions & 46 deletions

File tree

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build Extension Package
2+
3+
on:
4+
push:
5+
branches:
6+
- extension_test
7+
paths-ignore:
8+
- '.github/workflows/**' # Ignore changes to workflow files
9+
workflow_dispatch: # Allow manual trigger
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Compile
28+
run: npm run compile
29+
30+
- name: Install vsce
31+
run: npm install -g @vscode/vsce
32+
33+
- name: Package Extension
34+
run: vsce package
35+
36+
- name: Get Package Info
37+
id: package
38+
run: |
39+
VSIX_PATH=$(ls *.vsix)
40+
echo "Package created: $VSIX_PATH"
41+
echo "vsix_path=$VSIX_PATH" >> $GITHUB_OUTPUT
42+
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
43+
44+
- name: Upload VSIX as artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: extension-test-${{ steps.package.outputs.date }}
48+
path: "*.vsix"
49+
retention-days: 7

.github/workflows/publish.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: Publish Extension
1+
name: Publish Extension to Visual Studio Marketplace
22

33
on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- '.github/workflows/**' # Ignore changes to workflow files
79
workflow_dispatch: # Allow manual trigger
810

911
jobs:
@@ -32,5 +34,22 @@ jobs:
3234
- name: Package Extension
3335
run: vsce package
3436

37+
- name: Get Package Info
38+
id: package
39+
run: |
40+
VSIX_PATH=$(ls *.vsix)
41+
echo "Package created: $VSIX_PATH"
42+
echo "vsix_path=$VSIX_PATH" >> $GITHUB_OUTPUT
43+
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
44+
VERSION=$(node -p "require('./package.json').version")
45+
echo "version=$VERSION" >> $GITHUB_OUTPUT
46+
47+
- name: Upload VSIX as artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: extension-release-v${{ steps.package.outputs.version }}-${{ steps.package.outputs.date }}
51+
path: "*.vsix"
52+
retention-days: 400 # Maximum retention period allowed by GitHub
53+
3554
- name: Publish to Visual Studio Marketplace
3655
run: vsce publish -p "${{ secrets.VSC_PAT }}"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "simple-coding-time-tracker",
33
"displayName": "Simple Coding Time Tracker",
44
"description": "Track and visualize your coding time across projects",
5-
"version": "0.3.0",
5+
"version": "0.3.2",
66
"publisher": "noorashuvo",
77
"license": "MIT",
88
"icon": "icon-sctt.png",

0 commit comments

Comments
 (0)