Skip to content

chore: release v1.16.0 (#1069) #127

chore: release v1.16.0 (#1069)

chore: release v1.16.0 (#1069) #127

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
- "!v*-pre"
permissions:
contents: read
jobs:
package:
name: Package
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Verify tag is on main
run: |
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "Error: Release tags must be pushed from the main branch"
exit 1
fi
- name: Setup pnpm, Node.js, and dependencies
uses: ./.github/actions/setup
- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Release version: $VERSION"
- name: Validate version matches package.json
run: |
TAG_VERSION="${{ steps.version.outputs.version }}"
PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
echo "Please ensure the tag version matches the version in package.json"
exit 1
fi
echo "Version validation successful: $TAG_VERSION"
- name: Setup package path
id: setup
run: |
EXTENSION_NAME=$(node -e "console.log(require('./package.json').name)")
PACKAGE_NAME="${EXTENSION_NAME}-${{ steps.version.outputs.version }}.vsix"
echo "packageName=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Build extension
run: pnpm build:production
- name: Package extension
run: pnpm vsce package --no-dependencies --out "${{ steps.setup.outputs.packageName }}"
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: extension-${{ steps.version.outputs.version }}
path: ${{ steps.setup.outputs.packageName }}
if-no-files-found: error
publish:
name: Publish Extension and Create Release
needs: package
permissions:
# Required to create the GitHub release
contents: write
pull-requests: read
uses: ./.github/workflows/publish-extension.yaml
with:
version: ${{ needs.package.outputs.version }}
isPreRelease: false
secrets:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}