|
| 1 | +name: Publish VSCode Extension |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' # Jede Version wie v1.0.0 triggert Release & Publish |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Install Node.js |
| 17 | + uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version: 18 |
| 20 | + |
| 21 | + - name: Install dependencies |
| 22 | + run: npm install |
| 23 | + |
| 24 | + - name: Compile TypeScript |
| 25 | + run: npm run compile |
| 26 | + |
| 27 | + - name: Install vsce |
| 28 | + run: npm install -g @vscode/vsce |
| 29 | + |
| 30 | + - name: Create VSIX package |
| 31 | + run: vsce package |
| 32 | + |
| 33 | + - name: Upload VSIX artifact |
| 34 | + uses: actions/upload-artifact@v4 |
| 35 | + with: |
| 36 | + name: extension |
| 37 | + path: "*.vsix" |
| 38 | + |
| 39 | + release: |
| 40 | + needs: build |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Download artifact |
| 45 | + uses: actions/download-artifact@v4 |
| 46 | + with: |
| 47 | + name: extension |
| 48 | + |
| 49 | + - name: Create GitHub Release |
| 50 | + uses: softprops/action-gh-release@v1 |
| 51 | + with: |
| 52 | + files: "*.vsix" |
| 53 | + env: |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + |
| 56 | + publish: |
| 57 | + needs: release |
| 58 | + runs-on: ubuntu-latest |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: Checkout repository |
| 62 | + uses: actions/checkout@v4 |
| 63 | + |
| 64 | + - name: Install Node.js |
| 65 | + uses: actions/setup-node@v4 |
| 66 | + with: |
| 67 | + node-version: 18 |
| 68 | + |
| 69 | + - name: Install vsce |
| 70 | + run: npm install -g @vscode/vsce |
| 71 | + |
| 72 | + - name: Download VSIX artifact |
| 73 | + uses: actions/download-artifact@v4 |
| 74 | + with: |
| 75 | + name: extension |
| 76 | + |
| 77 | + - name: Publish to VSCode Marketplace |
| 78 | + run: vsce publish --packagePath *.vsix |
| 79 | + env: |
| 80 | + VSCE_PAT: ${{ secrets.VSCE_PAT }} |
0 commit comments