Merge pull request #355 from kitta65/feature/fix-format #305
Workflow file for this run
This file contains 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
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: npm | |
- run: npm ci | |
- run: npm run compile | |
- run: npm run lint | |
# NOTE | |
# official reference | |
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#automated-publishing | |
# | |
# You'll see `Failed to connect to the bus` many time. | |
# https://github.com/microsoft/vscode-test/issues/127 | |
- run: xvfb-run -a npm test | |
# upload package for debug | |
- run: npx vsce package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bq-extension-vscode.vsix | |
path: ./bq-extension-vscode-*.vsix | |
deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
if: ${{ github.ref_type == 'tag' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: npm | |
- uses: kitta65/tag-version-match@main | |
with: | |
file: ./package.json | |
query: .version | |
pattern: '^([0-9]+\.[0-9]+\.[0-9]+)$' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: bq-extension-vscode.vsix | |
- run: npx @vscode/vsce publish --packagePath ./bq-extension-vscode-*.vsix | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |