chore(master): release mmt 0.2.0 #6
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: {} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| RUSTFLAGS: -C debuginfo=0 | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| - name: Run Clippy | |
| run: cargo clippy --all -- -D warnings | |
| release_please: | |
| name: Release Management | |
| needs: [check] | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create Release | |
| id: release | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| config-file: .github/release-please-config.json | |
| manifest-file: .github/release-please-manifest.json | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish_deb: | |
| name: Publish Deb (${{ matrix.os }}) | |
| needs: release_please | |
| if: ${{ needs.release_please.outputs.release_created == 'true' }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-24.04] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y dh-make | |
| - name: Install cargo-deb | |
| run: cargo install cargo-deb | |
| - name: Build and Package | |
| run: | | |
| cargo deb -v | |
| VERSION="${{ needs.release_please.outputs.tag_name }}" | |
| VERSION=${VERSION#v} | |
| mv target/debian/*.deb "./target/mmtui_${VERSION}_amd64_${{ matrix.os }}.deb" | |
| - name: Upload DEB to Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload --clobber ${{ needs.release_please.outputs.tag_name }} \ | |
| ./target/*.deb | |
| publish_musl: | |
| name: Publish Musl (Static Linux) | |
| needs: release_please | |
| if: ${{ needs.release_please.outputs.release_created == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Musl Target and Tools | |
| run: | | |
| rustup target add x86_64-unknown-linux-musl | |
| sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Build Static Binary | |
| run: cargo build --release --target x86_64-unknown-linux-musl | |
| - name: Package Musl Binary | |
| run: | | |
| VERSION="${{ needs.release_please.outputs.tag_name }}" | |
| VERSION=${VERSION#v} | |
| ARCHIVE_NAME="mmtui_${VERSION}_x86_64-unknown-linux-musl.tar.gz" | |
| cd target/x86_64-unknown-linux-musl/release | |
| tar -czf "../../../$ARCHIVE_NAME" mmtui | |
| - name: Upload Musl Artifact | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload --clobber ${{ needs.release_please.outputs.tag_name }} \ | |
| *.tar.gz |