feat(extensions): add cmux sidebar integration extension (#45) #40
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: Auto Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Determine next version | |
| id: version | |
| run: | | |
| # Find the latest vX.Y.Z tag (or default to v0.0.0 if none) | |
| LATEST=$(git tag -l 'v*' --sort=-v:refname | head -1) | |
| if [ -z "$LATEST" ]; then | |
| LATEST="v0.0.0" | |
| fi | |
| # Count commits since that tag on HEAD | |
| COMMITS_SINCE=$(git rev-list "${LATEST}..HEAD" --count 2>/dev/null || echo "0") | |
| if [ "$COMMITS_SINCE" = "0" ]; then | |
| echo "No new commits since $LATEST — skipping release." | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| # Auto-bump patch: v1.0.0 → v1.0.1 | |
| V="${LATEST#v}" | |
| MAJOR="${V%%.*}" | |
| REST="${V#*.}" | |
| MINOR="${REST%%.*}" | |
| PATCH="${REST#*.}" | |
| NEXT_PATCH=$((PATCH + 1)) | |
| NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}" | |
| echo "Latest tag: $LATEST ($COMMITS_SINCE new commits)" | |
| echo "Next version: v${NEXT_VERSION}" | |
| echo "version=$NEXT_VERSION" >> "$GITHUB_OUTPUT" | |
| echo "tag=v$NEXT_VERSION" >> "$GITHUB_OUTPUT" | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| - name: Extract changelog | |
| if: steps.version.outputs.skip == 'false' | |
| run: python3 .github/scripts/extract-changelog.py "${{ steps.version.outputs.version }}" /tmp/release-notes.md | |
| - name: Create tag and GitHub release | |
| if: steps.version.outputs.skip == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG="${{ steps.version.outputs.tag }}" | |
| git tag "$TAG" | |
| git push origin "$TAG" | |
| gh release create "$TAG" \ | |
| --title "$TAG" \ | |
| --notes-file /tmp/release-notes.md |