From 486abe9d8c04c803dfa588d7c124d2dd64024c74 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 4 Apr 2024 08:51:36 -0400 Subject: [PATCH 1/2] ci: always build and upload the vsix artifact --- .github/workflows/publish.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1423b07..419a4b5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,12 +1,12 @@ on: push: tags: - - "v[0-9]*" + - 'v[0-9]*' branches: - - "main" + - 'main' pull_request: branches: - - "main" + - 'main' name: Deploy Extension jobs: @@ -16,21 +16,29 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: "18.x" + node-version: '18.x' - run: yarn install --immutable --immutable-cache --check-cache + + - name: Build Extension + run: yarn vsix + + - name: Upload extension to Actions Artifact + uses: actions/upload-artifact@v3 + with: + name: shiny-vscode + path: 'shiny*.vsix' + - name: Publish to Open VSX Registry uses: HaaLeo/publish-vscode-extension@v1 + if: ${{ github.repository_owner == 'posit-dev' }} with: pat: ${{ secrets.OPEN_VSX_TOKEN }} dryRun: ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }} + - name: Publish to Visual Studio Marketplace uses: HaaLeo/publish-vscode-extension@v1 + if: ${{ github.repository_owner == 'posit-dev' }} with: pat: ${{ secrets.VSCE_PAT }} registryUrl: https://marketplace.visualstudio.com dryRun: ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }} - - name: Upload extension to Actions Artifact - uses: actions/upload-artifact@v3 - with: - name: shiny-vscode - path: "shiny*.vsix" From 29ecbcab90b7b345f5fcd7fcbb6728c2db0fe577 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 4 Apr 2024 08:59:16 -0400 Subject: [PATCH 2/2] ci: Add `yarn vsix` --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 63da5da..56bb883 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,8 @@ "watch": "tsc -watch -p ./", "pretest": "yarn run compile && yarn run lint", "lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js" + "test": "node ./out/test/runTest.js", + "vsix": "npx @vscode/vsce package" }, "devDependencies": { "@types/glob": "^8.1.0",