diff --git a/.github/workflows/create_release_assets.yml b/.github/workflows/create_release_assets.yml index 613b40c2..5703861a 100644 --- a/.github/workflows/create_release_assets.yml +++ b/.github/workflows/create_release_assets.yml @@ -23,6 +23,11 @@ jobs: with: components: rustfmt, clippy + - name: Install cargo-deb + run: cargo install cargo-deb + if: ${{ matrix.platform == 'ubuntu-latest' }} + shell: bash + - name: Check format run: cargo fmt --all -- --check @@ -41,7 +46,7 @@ jobs: - name: Rename Release (Unix) run: | cargo install default-target - mkdir assets + mkdir -p assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) mv target/release/topgrade assets cd assets @@ -51,6 +56,24 @@ jobs: if: ${{ matrix.platform != 'windows-latest' }} shell: bash + - name: Build Debian-based system binary and create package + # First remove the binary built by previous steps + # because we don't want the auto-update feature, + # then build the new binary without auto-updating. + run: | + rm -rf target/release + cargo build --release + cargo deb --no-build --no-strip + if: ${{ matrix.platform == 'ubuntu-latest' }} + shell: bash + + - name: Move Debian-based system package + run: | + mkdir -p assets + mv target/debian/*.deb assets + if: ${{ matrix.platform == 'ubuntu-latest' }} + shell: bash + - name: Rename Release (Windows) run: | cargo install default-target diff --git a/.github/workflows/create_release_assets_cross.yml b/.github/workflows/create_release_assets_cross.yml index 6dcd8ad2..24972c26 100644 --- a/.github/workflows/create_release_assets_cross.yml +++ b/.github/workflows/create_release_assets_cross.yml @@ -29,6 +29,16 @@ jobs: with: components: rustfmt, clippy + - name: Install cargo-deb cross compilation dependencies + run: sudo apt-get install libc6-arm64-cross libgcc-s1-arm64-cross + if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} + shell: bash + + - name: Install cargo-deb + run: cargo install cargo-deb + if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} + shell: bash + - name: install targets run: rustup target add ${{ matrix.target }} @@ -54,7 +64,7 @@ jobs: - name: Rename Release run: | - mkdir assets + mkdir -p assets FILENAME=topgrade-${{github.event.release.tag_name}}-${{matrix.target}} mv target/${{matrix.target}}/release/topgrade assets cd assets @@ -62,6 +72,24 @@ jobs: rm topgrade ls . + - name: Build Debian-based system package without autoupdate feature + # First remove the binary built by previous steps + # because we don't want the auto-update feature, + # then build the new binary without auto-updating. + run: | + rm -rf target/${{matrix.target}} + cross build --release --target ${{matrix.target}} + cargo deb --target=${{matrix.target}} --no-build --no-strip + if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} + shell: bash + + - name: Move Debian-based system package + run: | + mkdir -p assets + mv target/${{matrix.target}}/debian/*.deb assets + if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} + shell: bash + - name: Release uses: softprops/action-gh-release@v2 with: diff --git a/Cargo.toml b/Cargo.toml index 79e0abad..ec8e2149 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,7 +59,15 @@ assets = [{ source = "target/release/topgrade", dest = "/usr/bin/topgrade" }] git = "*" [package.metadata.deb] -depends = "$auto,git" +name = "topgrade" +maintainer = "Chris Gelatt " +copyright = "2024, Topgrade Team" +license-file = ["LICENSE", "0"] +depends = "$auto" +extended-description = "Keeping your system up to date usually involves invoking multiple package managers. This results in big, non-portable shell one-liners saved in your shell. To remedy this, Topgrade detects which tools you use and runs the appropriate commands to update them." +section = "utils" +priority = "optional" +default-features = true [target.'cfg(unix)'.dependencies] nix = { version = "~0.29", features = ["hostname", "signal", "user"] }