Skip to content

Publish VS Code Extension #12

Publish VS Code Extension

Publish VS Code Extension #12

Workflow file for this run

name: Publish VS Code Extension
on:
workflow_dispatch:
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
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}