|
| 1 | +name: Release |
| 2 | + |
| 3 | +# Publishes the extension when you push a version tag, e.g.: |
| 4 | +# git tag v0.4.0 && git push origin v0.4.0 |
| 5 | +# It builds the VSIX, publishes to the VS Code Marketplace and Open VSX |
| 6 | +# (which is what Cursor / Windsurf / VSCodium / Gitpod install from), and |
| 7 | +# attaches the VSIX to a GitHub Release. |
| 8 | +# |
| 9 | +# Each publish step runs only if the matching token secret is set, so the |
| 10 | +# workflow won't fail if you've only configured one registry yet: |
| 11 | +# - VSCE_PAT -> VS Code Marketplace (https://marketplace.visualstudio.com/manage) |
| 12 | +# - OVSX_PAT -> Open VSX (https://open-vsx.org) |
| 13 | + |
| 14 | +on: |
| 15 | + push: |
| 16 | + tags: |
| 17 | + - 'v*.*.*' |
| 18 | + |
| 19 | +permissions: |
| 20 | + contents: write |
| 21 | + |
| 22 | +jobs: |
| 23 | + release: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + env: |
| 26 | + VSCE_PAT: ${{ secrets.VSCE_PAT }} |
| 27 | + OVSX_PAT: ${{ secrets.OVSX_PAT }} |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - uses: actions/setup-node@v4 |
| 33 | + with: |
| 34 | + node-version: 20 |
| 35 | + cache: 'npm' |
| 36 | + |
| 37 | + - name: Install dependencies |
| 38 | + run: npm ci |
| 39 | + |
| 40 | + - name: Type-check |
| 41 | + run: npm run check-types |
| 42 | + |
| 43 | + - name: Lint |
| 44 | + run: npm run lint |
| 45 | + |
| 46 | + - name: Test (unit) |
| 47 | + run: npm test |
| 48 | + |
| 49 | + - name: Build VSIX |
| 50 | + run: npm run vsix |
| 51 | + |
| 52 | + - name: Publish to VS Code Marketplace |
| 53 | + if: ${{ env.VSCE_PAT != '' }} |
| 54 | + run: npx vsce publish --packagePath angular-code-quality-toolkit.vsix |
| 55 | + |
| 56 | + - name: Publish to Open VSX |
| 57 | + if: ${{ env.OVSX_PAT != '' }} |
| 58 | + run: npx ovsx publish angular-code-quality-toolkit.vsix |
| 59 | + |
| 60 | + - name: Create GitHub Release |
| 61 | + env: |
| 62 | + GH_TOKEN: ${{ github.token }} |
| 63 | + run: > |
| 64 | + gh release create "${{ github.ref_name }}" |
| 65 | + angular-code-quality-toolkit.vsix |
| 66 | + --title "${{ github.ref_name }}" |
| 67 | + --notes "See [CHANGELOG.md](https://github.com/Arul1998/angular-code-quality-toolkit/blob/main/CHANGELOG.md) for what changed." |
0 commit comments