test: Fix ci format newlines #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Extension | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Version | |
| default: minor | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| - keep | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**.tmLanguage.json' | |
| - '**.language-configuration.json' | |
| - '**.ts' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Install Dependencies # vsce etc | |
| run: | # shell | |
| npm i | |
| - name: Build Extension # build `extension.js` and `*.wasm` files | |
| run: | # shell | |
| npm run build | |
| - name: Run Tests # check everything is working | |
| run: | # shell | |
| npm run test:grammar && npm run test:browser --- --headless | |
| - 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 tmlanguage-syntax-highlighter-$VERSION.vsix | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Publish Release # upload to Extension Marketplace | |
| run: | # shell | |
| npm run publish --- --packagePath tmlanguage-syntax-highlighter-$VERSION.vsix | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} |