Repository navigation
fix(agents): robust amp+pi integration with plugin handoff and fallbacks #33
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-version | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| jobs: | |
| version: | |
| runs-on: ubuntu-latest | |
| # Skip if the push was from this action (avoid infinite loop) | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get current version and compute next | |
| id: version | |
| run: | | |
| CURRENT=$(grep -o '"version": *"[^"]*"' package.json | head -1 | cut -d'"' -f4) | |
| echo "current=$CURRENT" | |
| # Extract base version and pre-release counter | |
| # e.g. 0.1.0-alpha.2 → base=0.1.0-alpha counter=2 | |
| if [[ "$CURRENT" =~ ^(.+)\.([0-9]+)$ ]]; then | |
| BASE="${BASH_REMATCH[1]}" | |
| COUNTER="${BASH_REMATCH[2]}" | |
| NEXT="${BASE}.$((COUNTER + 1))" | |
| else | |
| # No counter yet, start at .1 | |
| NEXT="${CURRENT}.1" | |
| fi | |
| echo "next=$NEXT" >> "$GITHUB_OUTPUT" | |
| echo "current=$CURRENT" >> "$GITHUB_OUTPUT" | |
| echo "Bumping $CURRENT → $NEXT" | |
| - name: Check if tag already exists | |
| id: check | |
| run: | | |
| TAG="v${{ steps.version.outputs.next }}" | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Bump version in package.json | |
| if: steps.check.outputs.exists == 'false' | |
| run: | | |
| NEXT="${{ steps.version.outputs.next }}" | |
| sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"$NEXT\"/" package.json | |
| - name: Commit and tag | |
| if: steps.check.outputs.exists == 'false' | |
| run: | | |
| NEXT="${{ steps.version.outputs.next }}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add package.json | |
| git commit -m "chore: bump version to $NEXT [skip ci]" | |
| git tag "v$NEXT" | |
| git push origin main --tags |