Publish VS Code Extension #6
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
name: Publish VS Code Extension | |
on: | |
release: | |
types: [published] | |
env: | |
extension-name: pipelines-tasks-devkit-${{ github.ref_name }}.vsix | |
# ref_name is the tag, specified in the release. | |
# Tag must contain the version of the extension. Ex: '1.0.0' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build the extension | |
run: yarn compile | |
- name: Run test on Linux | |
run: xvfb-run -a yarn test | |
if: runner.os == 'Linux' | |
- name: Run test on other OS | |
run: yarn test | |
if: runner.os != 'Linux' | |
- name: Package the extension | |
run: | | |
yarn global add @vscode/vsce | |
vsce package | |
- name: Get asset upload URL | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload Extension as Release Asset | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./${{ env.extension-name }} | |
asset_name: ${{ env.extension-name }} | |
asset_content_type: application/octet-stream | |
- name: Publish Extension | |
run: vsce publish --packagePath ${{ env.extension-name }} | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |