Publish to VSCode and OpenVSX Marketplace #28
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
| # This workflow publishes the extension to the VSCode marketplace when the version changes. | |
| name: Publish to VSCode and OpenVSX Marketplace | |
| on: | |
| # Run whenever a new commit is pushed to the main branch. | |
| push: | |
| branches: [ main ] | |
| paths: [ 'package.json' ] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: detect version | |
| uses: EndBug/version-check@v2.0.1 | |
| id: check | |
| if: github.event_name != 'workflow_dispatch' | |
| with: | |
| # Search the diff content for version changes. | |
| diff-search: true | |
| - name: npm ci | |
| run: npm ci | |
| - name: publish | |
| # if: steps.check.outputs.changed == 'true' | |
| # Token will expire. Regenerate it at Azure DevOps portal | |
| run: npm run publish -- -p "${{ secrets.VSCODE_MARKETPLACE_TOKEN }}" | |
| - name: publish to OpenVSX | |
| # if: steps.check.outputs.changed == 'true' | |
| # The token will expire. Regenerate it at: | |
| # https://open-vsx.org/user-settings/tokens | |
| run: npm run publish-openvsx -- -p "${{ secrets.OPENVSX_TOKEN }}" |