chore: bump extension version to 1.0.3 #6
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*'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate and Extract Version | |
| id: version | |
| run: | | |
| EXTENSION_VERSION=$(grep -oE '"version": *"[^"]*"' gemini-extension.json | head -n1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') | |
| if [[ -z "$EXTENSION_VERSION" ]]; then | |
| echo "::error::Could not extract version from gemini-extension.json" | |
| exit 1 | |
| fi | |
| echo "Detected extension version: $EXTENSION_VERSION" | |
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| # Verify tag matches extension version | |
| TAG_VERSION="${{ github.ref_name }}" | |
| TAG_VERSION="${TAG_VERSION#v}" | |
| if [[ "$TAG_VERSION" != "$EXTENSION_VERSION" ]]; then | |
| echo "::error::Tag version ($TAG_VERSION) does not match gemini-extension.json version ($EXTENSION_VERSION)" | |
| exit 1 | |
| fi | |
| echo "RELEASE_TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
| else | |
| # On branch, use extension version as tag | |
| echo "::warning::Running on branch '${{ github.ref_name }}'. Will release as v$EXTENSION_VERSION" | |
| echo "RELEASE_TAG=v$EXTENSION_VERSION" >> $GITHUB_OUTPUT | |
| echo "CREATE_TAG=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| if [ -z "$PREV_TAG" ]; then | |
| COMMITS=$(git log --pretty=format:"- %s" HEAD) | |
| else | |
| COMMITS=$(git log --pretty=format:"- %s" ${PREV_TAG}..HEAD) | |
| fi | |
| echo "commits<<EOF" >> $GITHUB_OUTPUT | |
| echo "$COMMITS" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.RELEASE_TAG }} | |
| target_commitish: ${{ github.sha }} | |
| body: | | |
| ## Changes | |
| ${{ steps.changelog.outputs.commits }} | |
| generate_release_notes: false | |
| draft: false | |
| prerelease: false |