chore: bump version to 0.3.12 #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-branch: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| on-main: ${{ steps.check.outputs.on-main }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - id: check | |
| run: | | |
| TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref }}) | |
| if git merge-base --is-ancestor "$TAG_COMMIT" origin/main; then | |
| echo "on-main=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "on-main=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| publish: | |
| needs: check-branch | |
| if: needs.check-branch.outputs.on-main == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| webview-ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install webview dependencies | |
| run: cd webview-ui && npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test | |
| - name: Package extension | |
| run: npx @vscode/vsce package | |
| - name: Upload .vsix artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: git-graph-plus-${{ github.ref_name }} | |
| path: '*.vsix' | |
| - name: Publish to VS Code Marketplace | |
| run: npx @vscode/vsce publish | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| - name: Publish to Open VSX | |
| run: npx ovsx publish *.vsix -p ${{ secrets.OVSX_PAT }} | |
| - name: Extract changelog | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| awk "/^## $VERSION/{p=1; next} /^## [0-9]/{if(p) exit} p" CHANGELOG.md > release_notes.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: '*.vsix' | |
| body_path: release_notes.txt | |
| token: ${{ secrets.RELEASE_TOKEN }} |