From b19d4bf0e5be30e854a80096cee3db62084d4b79 Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Fri, 19 Mar 2021 15:31:13 +0100 Subject: [PATCH] Publish to VS Marketplace and Open VXS Registry when GitHub release gets published --- .github/workflows/publish-extension.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish-extension.yml diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml new file mode 100644 index 0000000..1aff0aa --- /dev/null +++ b/.github/workflows/publish-extension.yml @@ -0,0 +1,38 @@ +name: Publish extension + +on: + release: + types: [published] + +jobs: + openvsx: + name: "Open VSX Registry" + if: endsWith(github.event.release.assets[0].name, '.vsix') + runs-on: ubuntu-latest + steps: + - name: Download release artifact + run: "curl -L -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H 'Accept: application/octet-stream' ${{ github.event.release.assets[0].url }} --output extension.vsix" + - name: Validate extension file + run: unzip -f extension.vsix extension/package.json + - name: Publish to Open VSX Registry + uses: HaaLeo/publish-vscode-extension@v0 + with: + pat: ${{ secrets.OPEN_VSX_TOKEN }} + extensionFile: extension.vsix + packagePath: '' + vs: + name: "Visual Studio Marketplace" + if: endsWith(github.event.release.assets[0].name, '.vsix') + runs-on: ubuntu-latest + steps: + - name: Download release artifact + run: "curl -L -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -H 'Accept: application/octet-stream' ${{ github.event.release.assets[0].url }} --output extension.vsix" + - name: Validate extension file + run: unzip -f extension.vsix extension/package.json + - name: Publish to Visual Studio Marketplace + uses: HaaLeo/publish-vscode-extension@v0 + with: + pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} + registryUrl: https://marketplace.visualstudio.com + extensionFile: extension.vsix + packagePath: ''