twc-rs 0.3.2

Fast single-binary CLI and interactive TUI dashboard for Timeweb Cloud
Documentation
name: Release

on:
  push:
    tags:
      - "v*"

permissions:
  contents: write

# release-plz creates the GitHub Release and its changelog body when it pushes
# the tag. This workflow only attaches build artifacts to that existing
# release — it never recreates or rewrites the release notes.
jobs:
  upload-assets:
    name: Build ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          # Linux targets cross-compile C dependencies (aws-lc-rs) with
          # cargo-zigbuild, which bundles its own cross toolchain — no system
          # OpenSSL or aarch64 GCC is needed on the runner.
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            build-tool: cargo-zigbuild
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest
            build-tool: cargo-zigbuild
          - target: x86_64-apple-darwin
            os: macos-latest
            build-tool: cargo
          - target: aarch64-apple-darwin
            os: macos-latest
            build-tool: cargo
          - target: x86_64-pc-windows-msvc
            os: windows-latest
            build-tool: cargo
    steps:
      - uses: actions/checkout@v7 # checkout repository
      # taiki-e/upload-rust-binary-action builds with --release, strips the
      # binary, archives (.tar.gz on unix / .zip on windows), generates the
      # checksum and uploads everything to the existing release for this tag.
      # build-tool is chosen per target: cargo-zigbuild for Linux cross builds,
      # cargo for native macOS/Windows targets.
      - name: Build and upload binary
        uses: taiki-e/upload-rust-binary-action@f0d45ae91ee7b8ee928de7a9d04d893a08bcbec6 # v1
        with:
          bin: twc-rs
          features: tui
          target: ${{ matrix.target }}
          build-tool: ${{ matrix.build-tool }}
          archive: $bin-$tag-$target
          checksum: sha256
          token: ${{ secrets.GITHUB_TOKEN }}

  deb:
    name: Build .deb package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7 # checkout repository
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable # stable toolchain
      - name: Install cargo-deb
        uses: taiki-e/install-action@v2 # pinned to major tag
        with:
          tool: cargo-deb
      - name: Build .deb
        run: cargo deb -- --features tui
      # Attach the .deb to the existing release without touching its notes.
      - name: Upload .deb to release
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: gh release upload "${GITHUB_REF_NAME}" target/debian/*.deb --clobber