diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2903047..977010a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,24 +5,42 @@ on: branches: [main] jobs: - build: + publish-vscode-marketplace: runs-on: ubuntu-latest - env: - VSCE_PAT: ${{ secrets.VSCE_PAT }} steps: - uses: actions/checkout@v3 - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '20.16.0' + node-version: "20.16.0" + + - name: Install dependencies + run: npm ci + + - name: Build extension + run: npm run build - # Only run publish step when pushing to main (not on PRs) - name: Publish to VS Code Marketplace if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: | - npm ci - # Extract version from package.json to use in the vsix filename - VERSION=$(node -p "require('./package.json').version") - npm run build - npx vsce publish -p ${{ secrets.VSCE_PAT }} + run: npx vsce publish -p ${{ secrets.VSCE_PAT }} + + publish-open-vsx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20.16.0" + + - name: Install dependencies + run: npm ci + + - name: Build extension + run: npm run build + + - name: Publish to Open VSX Registry + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: npx ovsx publish -p ${{ secrets.OVSX_PAT }} diff --git a/package.json b/package.json index 55fd69a..9eac281 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,9 @@ "pretest": "npm run compile-tests", "posttest": "npm run lint", "build": "npx vsce package", - "publish": "npx vsce publish" + "publish": "npx vsce publish", + "publish:ovsx": "npx ovsx publish", + "publish:all": "npm run publish && npm run publish:ovsx" }, "devDependencies": { "@types/chai": "^5.0.0",