Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/actions/set-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Set Version from Branch'
description: 'Sets VERSION environment variable from the current branch name'

runs:
using: composite
steps:
- name: Set version from branch name
shell: bash
run: |
# GITHUB_HEAD_REF contains the source branch for PRs (e.g., "v1.2.5"), but is empty for pushes
# GITHUB_REF_NAME contains the merge ref for PRs (e.g., "1/merge"), but the branch name for pushes
# Prefer GITHUB_HEAD_REF when available to get the actual branch name
if [ -n "$GITHUB_HEAD_REF" ]; then
BRANCH_NAME="$GITHUB_HEAD_REF"
else
BRANCH_NAME="$GITHUB_REF_NAME"
fi
# Strip leading 'v' if present
VERSION="${BRANCH_NAME#v}"

# Get version from package.json
PACKAGE_VERSION=$(node -p "require('./package.json').version")

# Verify versions match
if [ "$VERSION" != "$PACKAGE_VERSION" ]; then
echo "Error: Version mismatch!"
echo " Branch version: $VERSION"
echo " package.json version: $PACKAGE_VERSION"
echo "Please ensure the branch name matches the version in package.json"
exit 1
fi

echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Using version: $VERSION (from branch: $BRANCH_NAME)"
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Format
run: npx biome ci .

- name: Lint
run: npx eslint
run: make lint

test:
name: Test
Expand All @@ -54,6 +51,6 @@ jobs:
env:
LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect?name=VSCode
NODE_ENV: ci

- name: Test
run: xvfb-run -a npx vscode-test
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Publish Extension

on:
workflow_dispatch:
inputs:
publish_vscode_marketplace:
description: 'Publish to VS Marketplace'
type: boolean
default: true
publish_ovsx:
description: 'Publish to Open VSX'
type: boolean
default: true

permissions:
contents: read

jobs:
publish-vscode-marketplace:
name: Publish to VS Marketplace
runs-on: ubuntu-latest
if: ${{ inputs.publish_vscode_marketplace != false }}

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm

- name: Install dependencies
run: npm ci

- name: Set version from branch name
uses: ./.github/actions/set-version

- name: Publish to VS Marketplace
run: make publish-marketplace
env:
VERSION: ${{ env.VERSION }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect?name=VSCode
NODE_ENV: production
ANALYTICS_API_URL: https://analytics.localstack.cloud/v1/events

publish-ovsx:
name: Publish to Open VSX
runs-on: ubuntu-latest
if: ${{ inputs.publish_ovsx != false }}

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm

- name: Install dependencies
run: npm ci

- name: Set version from branch name
uses: ./.github/actions/set-version

- name: Publish to Open VSX
run: make publish-ovsx
env:
VERSION: ${{ env.VERSION }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect?name=VSCode
NODE_ENV: production
ANALYTICS_API_URL: https://analytics.localstack.cloud/v1/events
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.5 (2025-11-05) (pre-release)

- chore: Testing publishing from Github action

## 1.2.4 (2025-10-13)

- chore: Update dependencies
Expand Down Expand Up @@ -77,4 +81,4 @@ Initial preview release.

- Add feature deploy Lambda to LocalStack
- Add feature invoke Lambda in LocalStack
- Add Python CodeLens for triggering deploy and invoke commands
- Add Python CodeLens for triggering deploy and invoke commands
38 changes: 29 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
.PHONY: vsix publish
.PHONY: publish-ovsx publish-marketplace lint test

vsix:
@echo "Packaging VS Code extension into VSIX file..."
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
@hash=$$(git rev-parse --short HEAD); \
mv localstack-1.0.0.vsix localstack-1.0.0-$$hash.vsix
# VERSION can be set via environment variable or defaults to the version in package.json
VERSION ?= $(shell node -p "require('./package.json').version")

lint:
@echo "Running format check..."
npx biome ci .
@echo "Running linter..."
npx eslint

test:
@echo "Running type check..."
npx tsc
@echo "Compiling extension..."
npx vsce package
@echo "Running tests..."
npx vscode-test

publish-marketplace:
@echo "Publishing VS Code extension to VS Marketplace..."
@echo "Verifying PAT..."
npx vsce verify-pat localstack -p $(VSCE_PAT)
npx vsce publish $(VERSION) -p $(VSCE_PAT) --no-update-package-json

publish-ovsx:
@echo "Publishing VS Code extension to Open VSX..."
@echo "Verifying PAT..."
npx ovsx verify-pat localstack -p $(OVSX_PAT)
npx ovsx publish --packageVersion $(VERSION) -p $(OVSX_PAT)

publish:
@echo "Publishing VS Code extension..."
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "LocalStack",
"displayName": "LocalStack Toolkit",
"description": "LocalStack - Run locally, deploy globally!",
"version": "1.2.4",
"version": "1.2.5",
"engines": {
"node": ">=20",
"vscode": "^1.83.0"
Expand Down
Loading