Skip to content

Set version in release #7

Set version in release

Set version in release #7

on:
release:
types:
- published
pull_request:
branches:
- "*"
# NOTE: this is a separate workflow because
# the version-setting relies on environment variables,
# and that works differently in powershell.
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'yarn'
- run: yarn install --ignore-engines
- name: Write release version
run: |
$env:GITHUB_REF_NAME = "v1.0.0"
$env:GITHUB_REF_NAME -match "v(?<version>.*)"
$VERSION=$Matches['version']
"Version: $VERSION"
$env:GITHUB_ENV += "\nVERSION=$VERSION"
- run: "npm version 1.0.0 --no-git-tag-version"
- name: Publish
run: yarn deploy
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}