Skip to content

Release

Release #12

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
releaseType:
required: true
default: 'minor'
type: choice
options:
- major
- minor
- patch
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install deps
run: npm ci
- name: Run Tests
run: xvfb-run -a npm test
if: runner.os == 'Linux'
- name: Run Tests
run: npm test
if: runner.os != 'Linux'
- name: Package
if: success() && matrix.os == 'ubuntu-latest'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
npm run package ${RELEASE_TYPE}
echo "packageFile=$(ls *.vsix)" >> $GITHUB_ENV
env:
RELEASE_TYPE: ${{ inputs.releaseType }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
if: success() && matrix.os == 'ubuntu-latest'
run: |
npm run publish -- -i ${VSIX_PATH}
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
VSIX_PATH: ${{ env.packageFile }}
- name: Push tag
if: success() && matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --tags
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
if: success() && matrix.os == 'ubuntu-latest'
with:
files: |
${{ env.packageFile }}