Release #3
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: Release | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
publishMS: | |
description: "Publish to MS marketplace" | |
type: boolean | |
required: true | |
default: true | |
publishGH: | |
description: "Publish to GitHub releases" | |
type: boolean | |
required: true | |
default: true | |
permissions: | |
contents: write | |
jobs: | |
package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run: npm install | |
- name: Package Extension | |
run: npx vsce package | |
id: package | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: package | |
path: "*.vsix" | |
publishMS: | |
runs-on: ubuntu-latest | |
needs: package | |
if: github.event.inputs.publishMS == 'true' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: package | |
path: . | |
- name: Publish to VS Code Marketplace | |
run: npx vsce publish -p ${{ secrets.VSCE_PAT }} --packagePath *.vsix | |
publishGH: | |
runs-on: ubuntu-latest | |
needs: package | |
if: github.event.inputs.publishGH == 'true' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: package | |
path: . | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "*.vsix" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |