This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
Republish #172
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
name: Test and Publish | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
jobs: | |
test-and-package: | |
runs-on: ubuntu-latest | |
outputs: | |
vsixPath: ${{ steps.package.outputs.vsixPath }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: xvfb-run --auto-servernum npm test | |
- name: Build package | |
id: package | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: stub | |
dryRun: true | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: package | |
path: ${{ steps.package.outputs.vsixPath }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: [ test-and-package ] | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: package | |
- name: Publish to Open VSX Registry | |
uses: HaaLeo/publish-vscode-extension@v1 | |
id: publishToOpenVSX | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
extensionFile: ${{ needs.test-and-package.outputs.vsixPath }} | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: ${{ needs.test-and-package.outputs.vsixPath }} |