fix(v0.2.1): add Grafana auth, human-readable errors, and port overri… #1
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-tag and release on version bump | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - mcp-server/package.json | |
| permissions: | |
| contents: write | |
| jobs: | |
| tag-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Detect version change | |
| id: version | |
| run: | | |
| CURRENT=$(jq -r .version mcp-server/package.json) | |
| PREVIOUS=$(git show HEAD~1:mcp-server/package.json 2>/dev/null | jq -r .version 2>/dev/null || echo "") | |
| echo "current=$CURRENT" >> "$GITHUB_OUTPUT" | |
| echo "previous=$PREVIOUS" >> "$GITHUB_OUTPUT" | |
| if [ "$CURRENT" != "$PREVIOUS" ] && [ -n "$CURRENT" ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Check tag does not already exist | |
| if: steps.version.outputs.changed == 'true' | |
| id: check-tag | |
| run: | | |
| TAG="v${{ steps.version.outputs.current }}" | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create tag and GitHub release | |
| if: steps.version.outputs.changed == 'true' && steps.check-tag.outputs.exists == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG="v${{ steps.version.outputs.current }}" | |
| git tag "$TAG" | |
| git push origin "$TAG" | |
| gh release create "$TAG" \ | |
| --title "$TAG" \ | |
| --generate-notes \ | |
| --latest |