File tree Expand file tree Collapse file tree 7 files changed +1116
-985
lines changed
Expand file tree Collapse file tree 7 files changed +1116
-985
lines changed Original file line number Diff line number Diff line change 1+ name : ' Set Version from Branch'
2+ description : ' Sets VERSION environment variable from the current branch name'
3+
4+ runs :
5+ using : composite
6+ steps :
7+ - name : Set version from branch name
8+ shell : bash
9+ run : |
10+ # Use GITHUB_HEAD_REF for PRs, GITHUB_REF_NAME for direct pushes
11+ if [ -n "$GITHUB_HEAD_REF" ]; then
12+ BRANCH_NAME="$GITHUB_HEAD_REF"
13+ else
14+ BRANCH_NAME="$GITHUB_REF_NAME"
15+ fi
16+ # Strip leading 'v' if present
17+ VERSION="${BRANCH_NAME#v}"
18+
19+ # Get version from package.json
20+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
21+
22+ # Verify versions match
23+ if [ "$VERSION" != "$PACKAGE_VERSION" ]; then
24+ echo "Error: Version mismatch!"
25+ echo " Branch version: $VERSION"
26+ echo " package.json version: $PACKAGE_VERSION"
27+ echo "Please ensure the branch name matches the version in package.json"
28+ exit 1
29+ fi
30+
31+ echo "VERSION=$VERSION" >> $GITHUB_ENV
32+ echo "Using version: $VERSION (from branch: $BRANCH_NAME)"
Original file line number Diff line number Diff line change 2424 - name : Install dependencies
2525 run : npm ci
2626
27- - name : Format
28- run : npx biome ci .
29-
3027 - name : Lint
31- run : npx eslint
28+ run : make lint
3229
3330 test :
3431 name : Test
4643 - name : Install dependencies
4744 run : npm ci
4845
49- - name : Type check
50- run : npx tsc
51-
52- - name : Compile
53- run : npx vsce package
46+ - name : Test
47+ run : make test
5448 env :
5549 LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect?name=VSCode
5650 NODE_ENV : ci
57-
58- - name : Test
59- run : xvfb-run -a npx vscode-test
Original file line number Diff line number Diff line change 1+ name : Publish to Open VSX
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ contents : read
8+
9+ jobs :
10+ publish :
11+ name : Publish to Open VSX
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v5
17+
18+ - name : Setup Node
19+ uses : actions/setup-node@v4
20+ with :
21+ cache : npm
22+
23+ - name : Install dependencies
24+ run : npm ci
25+
26+ - name : Set version from branch name
27+ uses : ./.github/actions/set-version
28+
29+ - name : Publish to Open VSX
30+ run : make publish-ovsx
31+ env :
32+ VERSION : ${{ env.VERSION }}
33+ OVSX_PAT : ${{ secrets.OVSX_PAT }}
34+ LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect?name=VSCode
35+ NODE_ENV : production
36+ ANALYTICS_API_URL : https://analytics.localstack.cloud/v1/events
Original file line number Diff line number Diff line change 1+ name : Publish to Visual Studio Marketplace
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ contents : read
8+
9+ jobs :
10+ publish :
11+ name : Publish to VS Marketplace
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v5
17+
18+ - name : Setup Node
19+ uses : actions/setup-node@v4
20+ with :
21+ cache : npm
22+
23+ - name : Install dependencies
24+ run : npm ci
25+
26+ - name : Set version from branch name
27+ uses : ./.github/actions/set-version
28+
29+ - name : Publish to VS Marketplace
30+ run : make publish-marketplace
31+ env :
32+ VERSION : ${{ env.VERSION }}
33+ VSCE_PAT : ${{ secrets.VSCE_PAT }}
34+ LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect?name=VSCode
35+ NODE_ENV : production
36+ ANALYTICS_API_URL : https://analytics.localstack.cloud/v1/events
Original file line number Diff line number Diff line change 1- .PHONY : vsix publish
1+ .PHONY : vsix publish publish-ovsx publish-marketplace lint test
22
3- vsix :
4- @echo " Packaging VS Code extension into VSIX file..."
5- LOCALSTACK_WEB_AUTH_REDIRECT=https://app.localstack.cloud/redirect? name=VSCode NODE_ENV=production ANALYTICS_API_URL=https://analytics.localstack.cloud/v1/events npx vsce package
6- @hash=$$(git rev-parse --short HEAD ) ; \
7- mv localstack-1.0.0.vsix localstack-1.0.0-$$ hash.vsix
3+ # VERSION can be set via environment variable or defaults to the version in package.json
4+ VERSION ?= $(shell node -p "require('./package.json') .version")
5+
6+ lint :
7+ @echo " Running format check..."
8+ npx biome ci .
9+ @echo " Running linter..."
10+ npx eslint
11+
12+ test :
13+ @echo " Running type check..."
14+ npx tsc
15+ @echo " Compiling extension..."
16+ npx vsce package
17+ @echo " Running tests..."
18+ xvfb-run -a npx vscode-test
19+
20+ publish-marketplace :
21+ @echo " Publishing VS Code extension to VS Marketplace..."
22+ @echo " Verifying PAT..."
23+ npx vsce verify-pat localstack -p $(VSCE_PAT )
24+ npx vsce publish --pre-release $(VERSION ) -p $(VSCE_PAT ) --no-update-package-json
25+
26+ publish-ovsx :
27+ @echo " Publishing VS Code extension to Open VSX..."
28+ @echo " Verifying PAT..."
29+ npx ovsx verify-pat localstack -p $(OVSX_PAT )
30+ npx ovsx publish --pre-release --packageVersion $(VERSION ) -p $(OVSX_PAT )
831
9- publish :
10- @echo " Publishing VS Code extension..."
11- LOCALSTACK_WEB_AUTH_REDIRECT=https://app.localstack.cloud/redirect? name=VSCode NODE_ENV=production ANALYTICS_API_URL=https://analytics.localstack.cloud/v1/events npx vsce publish
You can’t perform that action at this time.
0 commit comments