ci: update git-cliff release action #4
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*.*.*' | |
| jobs: | |
| release: | |
| name: Build & Publish Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # full history needed for git-cliff | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| cache: maven | |
| - name: Build JAR | |
| run: mvn --batch-mode clean package -DskipTests | |
| - name: Generate changelog with git-cliff | |
| id: cliff | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --latest --strip header | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPO: ${{ github.repository }} | |
| - name: Update CHANGELOG.md | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --output CHANGELOG.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPO: ${{ github.repository }} | |
| - name: Commit updated CHANGELOG | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add CHANGELOG.md | |
| git diff --staged --quiet || git commit -m "docs: update CHANGELOG for ${{ github.ref_name }}" | |
| git push origin HEAD:main || true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: StackLens ${{ github.ref_name }} | |
| body: | | |
| ${{ steps.cliff.outputs.content }} | |
| --- | |
| ### Download & Run | |
| **Requirements:** Java 17 or higher | |
| ```bash | |
| java -jar stacklens.jar analyze app.log | |
| java -jar stacklens.jar analyze app.log --summary | |
| cat app.log | java -jar stacklens.jar analyze - | |
| ``` | |
| ### Create an alias | |
| **Linux/macOS:** | |
| ```bash | |
| alias stacklens='java -jar /path/to/stacklens.jar' | |
| ``` | |
| **Windows PowerShell:** | |
| ```powershell | |
| function stacklens { java -jar C:\path\to\stacklens.jar $args } | |
| ``` | |
| files: target/stacklens.jar | |
| draft: false | |
| prerelease: false |