holmgr / cargo-sweep

A cargo subcommand for cleaning up unused build files generated by Cargo
MIT License
693 stars 31 forks source link

Release binaries #64

Closed Madoshakalaka closed 1 year ago

Madoshakalaka commented 2 years ago

Since most likely this tool will get used in CI, it's really optimal to include built binaries in the releases.

and advise users to download binaries in the following way wget -qO- https://github.com/holmgr/cargo-sweep/releases/download/${VERSION}/cargo-sweep-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-

trunk is an excellent reference to the CI setup for prebuilt binaries.

Madoshakalaka commented 2 years ago

In the time being, I recommend using the following github action to build the binary and commit to your repo peoriodically or on manual trigger:

name: Build Cargo Sweep Binary

on:
  schedule:
    # friday noon
    - cron: '0 12 * * 5'
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Build
      run: cargo install cargo-sweep
    - uses: actions/checkout@v2
    - name: Transfer Binary
      run: 'mv ~/.cargo/bin/cargo-sweep YOUR/PATH/TO/CI-BIN'
    - name: Commit Binary
      uses: stefanzweifel/git-auto-commit-action@v4
      with:
        commit_message: "🤖 build cargo-sweep binary for ci use"
Madoshakalaka commented 2 years ago

Consider setting up cargo-bininstall too, after the CI is setup

jyn514 commented 1 year ago

Duplicate of https://github.com/holmgr/cargo-sweep/issues/28