Deploy #11
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
name: Deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
publish-extension: | |
name: Publish to marketplace | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Install dependencies | |
run: npm --color ci | |
- name: Read version from package.json | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
echo "version=$VERSION" >> $GITHUB_ENV | |
- name: Create Git tag | |
run: | | |
git tag ${{ env.version }} | |
git push origin ${{ env.version }} | |
- name: Publish to Open VSX Registry | |
id: publishToOpenVSX | |
uses: HaaLeo/publish-vscode-extension@v2 | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v2 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} |