chore: Release mostro-cli version 0.13.3 #382
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 Tag | |
| on: | |
| push: | |
| tags: ['v*'] # run only when a tag like v1.2.3 is pushed | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # Generate changelog (runs once) | |
| changelog: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| content: ${{ steps.changelog.outputs.content }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate changelog | |
| uses: orhun/git-cliff-action@v4 | |
| id: changelog | |
| with: | |
| config: cliff.toml | |
| args: --latest --strip header --output CHANGELOG.md | |
| env: | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REF: ${{ github.ref }} | |
| - 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 commit -m "chore: update changelog for ${{ github.ref_name }}" | |
| git push origin HEAD:main | |
| # Build binaries for multiple platforms | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| needs: changelog | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact_name: mostro-cli-linux | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact_name: mostro-cli-windows.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install target | |
| run: rustup target add ${{ matrix.target }} | |
| - name: Run tests | |
| run: cargo test --locked | |
| - name: Build release | |
| run: cargo build --release --locked --target ${{ matrix.target }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: target/${{ matrix.target }}/release/mostro-cli* | |
| # Create release with all artifacts | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [changelog, build] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body: ${{ needs.changelog.outputs.content }} | |
| files: | | |
| mostro-cli-linux/mostro-cli | |
| mostro-cli-windows.exe/mostro-cli.exe | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |