Skip to content

test: Fix tests on Linux. Double Quotes #11

test: Fix tests on Linux. Double Quotes

test: Fix tests on Linux. Double Quotes #11

Workflow file for this run

name: Publish Extension
on:
workflow_dispatch:
inputs:
version:
description: Version
default: minor
type: choice
options:
- patch
- minor
- major
- keep
push:
branches:
- main
paths:
- '**.json'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Dependencies # vsce etc
run: | # shell
npm i
- name: Run Tests # check grammars are working
run: | # shell
npm run test
- name: Setup Github Actions # allow use of `git push`
run: | # shell
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff-index --quiet HEAD || git commit -m "Sync Github Actions" || exit 0
- name: Package Extension # `.vsix` file
run: | # shell
if [ "${{ github.event.inputs.version }}" = "keep" ]; then
npm run package
elif [ "${{ github.event.inputs.version }}" = "" ]; then
npm run package --- patch --pre-release
else
npm run package --- ${{ github.event.inputs.version }}
fi
git push --follow-tags
echo VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
- name: Generate Release # create release page on github with `.vsix` file
if: github.event.inputs.version
run: | # shell
gh release create v$VERSION --generate-notes json-embedded-languages-$VERSION.vsix
env:
GH_TOKEN: ${{ github.token }}
- name: Publish Release # upload to Extension Marketplace
run: | # shell
npm run publish --- --packagePath json-embedded-languages-$VERSION.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}