Skip to content

1.0.7

1.0.7 #10

Workflow file for this run

name: Release & Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
dry_run:
description: "Only build & validate, skip release and publish"
type: boolean
default: false
permissions:
contents: write
env:
VERSION_TAG: ${{ github.ref_name }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.11.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Compile extension
run: pnpm run compile
- name: Determine version label
id: label
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
else
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Package VSIX
run: npx @vscode/vsce package --out version-bump-${{ steps.label.outputs.tag }}.vsix
- name: Generate release notes
id: notes
run: |
echo "notes<<EOF" >> "$GITHUB_OUTPUT"
echo "## What's Changed" >> "$GITHUB_OUTPUT"
echo "" >> "$GITHUB_OUTPUT"
prev_tag=$(git tag --sort=-version:refname | head -n2 | tail -n1)
if [ -n "$prev_tag" ]; then
git log --oneline --no-decorate "$prev_tag..HEAD" | sed 's/^/- /' >> "$GITHUB_OUTPUT"
else
git log --oneline --no-decorate | sed 's/^/- /' >> "$GITHUB_OUTPUT"
fi
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: ${{ steps.notes.outputs.notes }}
files: version-bump-${{ steps.label.outputs.tag }}.vsix
draft: false
prerelease: false
- name: Publish to VS Code Marketplace
if: ${{ !inputs.dry_run }}
run: npx @vscode/vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}