From be257223008a9ee481b6a7b350504ee55c4b42f2 Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Mon, 18 Jul 2022 17:38:42 +0200 Subject: [PATCH] Publish to open-vsx Signed-off-by: Fred Bricon --- .github/workflows/ci.yaml | 19 ++++++++++++++----- src/CodeLensProvider.ts | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c52c5c9..8119fb6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,10 @@ jobs: - name: Build vsix working-directory: ./jbang-vscode - run: vsce package --pre-release + run: | + node ./scripts/create-package-insiders-json.js + mv ./package.insiders.json ./package.json + vsce package --pre-release - name: Upload vsix uses: actions/upload-artifact@v3 @@ -62,12 +65,18 @@ jobs: files: | jbang-vscode/*.vsix + - name: Publish to Open VSX Marketplace + if: github.ref == 'refs/heads/main' + working-directory: ./jbang-vscode + run: | + npx ovsx publish --pre-release -p $OVSX_TOKEN + env: + OVSX_TOKEN: ${{ secrets.OPENVSX_MARKETPLACE_TOKEN }} + - name: Publish to VSCode Marketplace if: github.ref == 'refs/heads/main' working-directory: ./jbang-vscode run: | - node ./scripts/create-package-insiders-json.js - mv ./package.insiders.json ./package.json - vsce publish --pre-release -p $VSCE_TOKEN + npx vsce publish --pre-release -p $VSCE_TOKEN env: - VSCE_TOKEN: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} \ No newline at end of file + VSCE_TOKEN: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} diff --git a/src/CodeLensProvider.ts b/src/CodeLensProvider.ts index 6ce3f3b..ad7a72b 100644 --- a/src/CodeLensProvider.ts +++ b/src/CodeLensProvider.ts @@ -43,7 +43,7 @@ export class CodeLensProvider implements CodeLensProvider { break; } } - if (firstDirectivePosition !== undefined) { + if (firstDirectivePosition) { codelenses.push(new CodeLens(firstDirectivePosition, { command: "jbang.synchronize", title: "Synchronize JBang",