Skip to content

chore: bump version to 0.2.12 #18

chore: bump version to 0.2.12

chore: bump version to 0.2.12 #18

Workflow file for this run

name: Publish Extension
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to publish (e.g., v2.17.244)"
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Subversion
run: |
sudo apt-get update -qq
sudo apt-get install -y subversion
- name: Lint check
run: npm run lint --silent -- -f stylish
- name: Build extension
run: npm run build
- name: Run tests
run: xvfb-run -a npx vscode-test
env:
CODE_VERSION: stable
NODE_OPTIONS: --max-old-space-size=6144
- name: Get version from tag
id: get_version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "VERSION=${{ inputs.tag }}" >> $GITHUB_OUTPUT
echo "TAG=${{ inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Extract changelog for version
id: changelog
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
echo "Extracting changelog for version $VERSION"
CHANGELOG=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d' | tail -n +2)
if [ -z "$CHANGELOG" ]; then
CHANGELOG="Release $VERSION"
fi
echo "$CHANGELOG" > /tmp/changelog.txt
{
echo 'NOTES<<EOF'
cat /tmp/changelog.txt
echo EOF
} >> $GITHUB_OUTPUT
- name: Compile tools
run: npm run build:ts
- name: Package extension
run: npm run organize && npx @vscode/vsce package -o sven.vsix
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.OVSX_PAT }}
registryUrl: https://open-vsx.org
extensionFile: sven.vsix
- name: Publish to VS Code Marketplace
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.VSCE_PAT }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: sven.vsix
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.TAG }}
name: Release ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.changelog.outputs.NOTES }}
files: sven.vsix
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}