diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..30b5465 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,80 @@ +name: Publish VSCode Extension + +on: + push: + tags: + - 'v*' # Jede Version wie v1.0.0 triggert Release & Publish + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Compile TypeScript + run: npm run compile + + - name: Install vsce + run: npm install -g @vscode/vsce + + - name: Create VSIX package + run: vsce package + + - name: Upload VSIX artifact + uses: actions/upload-artifact@v4 + with: + name: extension + path: "*.vsix" + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: extension + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: "*.vsix" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish: + needs: release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install vsce + run: npm install -g @vscode/vsce + + - name: Download VSIX artifact + uses: actions/download-artifact@v4 + with: + name: extension + + - name: Publish to VSCode Marketplace + run: vsce publish --packagePath *.vsix + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }}