From fc19b1fcbc9a2127cdc2c48169011f003761bbac Mon Sep 17 00:00:00 2001 From: AdamRaichu <91494019+AdamRaichu@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:48:52 -0400 Subject: [PATCH] update publish.yml --- .github/workflows/publish.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 10ed9b1..6119f55 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,30 +10,52 @@ on: type: boolean required: false default: false + workflow_call: + secrets: + AZURE_PAT: + required: true + description: The PAT to use to publish the extension. + inputs: + preRelease: + type: boolean + required: true + default: false + continueOnTagErr: + type: boolean + required: false + default: false +permissions: + contents: write jobs: build: - permissions: - contents: write 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 = "actions@github.com" + git pull - uses: jozsefsallai/node-package-version@v1.0.4 name: get package version as env variable - name: Create a tag continue-on-error: ${{ inputs.continueOnTagErr }} run: | - git config user.name = "Github Actions" - git config user.email = "actions@github.com" 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 }} - name: Publish to Visual Studio Marketplace uses: HaaLeo/publish-vscode-extension@v1 with: pat: ${{ secrets.AZURE_PAT }} registryUrl: https://marketplace.visualstudio.com - preRelease: ${{ inputs.preRelease }} + extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} \ No newline at end of file