Skip to content
Merged
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
18 changes: 16 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Extension
on:
push:
tags:
- "*"
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
test:
Expand Down Expand Up @@ -49,7 +49,21 @@ jobs:
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Determine release type
id: release_type
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Version: $VERSION"
MINOR=$(echo $VERSION | cut -d. -f2)
echo "Minor: $MINOR"
if [ $((MINOR % 2)) -eq 1 ]; then
echo "Publishing as pre-release"
echo "prerelease_flag=--pre-release" >> $GITHUB_OUTPUT
else
echo "Publishing as stable release"
echo "prerelease_flag=" >> $GITHUB_OUTPUT
fi
- name: Package extension
run: npx vsce package --yarn
- name: Publish to VSCode Marketplace
run: npx vsce publish --yarn -p ${{ secrets.VSCE_PAT }}
run: npx vsce publish --yarn ${{ steps.release_type.outputs.prerelease_flag }} -p ${{ secrets.VSCE_PAT }}