Publish Extension #94
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 Extension | |
on: | |
workflow_dispatch: | |
inputs: | |
preRelease: | |
type: boolean | |
required: true | |
default: false | |
continueOnTagErr: | |
type: boolean | |
required: false | |
default: false | |
workflow_call: | |
secrets: | |
AZURE_PAT: | |
required: true | |
description: The PAT to use to publish the extension to the vscode marketplace. | |
OPEN_VSX_TOKEN: | |
required: true | |
description: The PAT to use to public the extension to open-vsx.org. | |
inputs: | |
preRelease: | |
type: boolean | |
required: true | |
default: false | |
continueOnTagErr: | |
type: boolean | |
required: false | |
default: false | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout repository | |
- name: Configure git | |
run: | | |
git config user.name = "Github Actions" | |
git config user.email = "[email protected]" | |
git pull | |
- uses: jozsefsallai/[email protected] | |
name: get package version as env variable | |
- name: Create a tag | |
continue-on-error: ${{ inputs.continueOnTagErr }} | |
run: | | |
git tag -a v${{ env.PACKAGE_VERSION }} -m "Version ${{ env.PACKAGE_VERSION }}" | |
git push origin v${{ env.PACKAGE_VERSION }} | |
- name: Generate Files | |
run: | | |
npm i | |
npm run build | |
- name: Publish to Open VSX Registry | |
uses: HaaLeo/publish-vscode-extension@v1 | |
id: publishToOpenVSX | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
preRelease: ${{ inputs.preRelease }} | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.AZURE_PAT }} | |
preRelease: ${{ inputs.preRelease }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} |