From 1ad67e8db987596fcd6c9f02ce4c2e4e762a7fc8 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 25 Jun 2022 23:24:03 +0530 Subject: [PATCH] Add release workflow --- .cargo/config.toml | 5 +++++ .github/workflows/release.yml | 16 ++++++++++++++++ Cargo.toml | 5 ++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 35049cb..4b40e31 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,7 @@ [alias] xtask = "run --package xtask --" + +# On Windows MSVC, statically link the C runtime so that the resulting EXE does +# not depend on the vcruntime DLL. +[target.'cfg(all(windows, target_env = "msvc"))'] +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a4ae52..08cc90c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,12 +21,14 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-musl + deb: true - os: ubuntu-latest target: arm-unknown-linux-musleabihf - os: ubuntu-latest target: armv7-unknown-linux-musleabihf - os: ubuntu-latest target: aarch64-unknown-linux-musl + deb: true - os: macos-11 target: x86_64-apple-darwin @@ -61,6 +63,13 @@ jobs: override: true target: ${{ matrix.target }} + - name: Install cargo-deb + if: ${{ matrix.deb == true }} + uses: actions-rs/install@v0.1 + with: + crate: cargo-deb + version: latest + - name: Setup cache uses: Swatinem/rust-cache@v1 @@ -71,6 +80,13 @@ jobs: args: --release --locked --target=${{ matrix.target }} --color=always --verbose use-cross: ${{ runner.os == 'Linux' }} + - name: Build deb + if: ${{ matrix.deb == true }} + uses: actions-rs/cargo@v1 + with: + command: deb + args: --no-build --target=${{ matrix.target }} + - name: Package (*nix) if: runner.os != 'Windows' run: > diff --git a/Cargo.toml b/Cargo.toml index 4bf2c6d..676dcfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" homepage = "https://github.com/ajeetdsouza/zoxide" keywords = ["cli"] license = "MIT" -license-file = "LICENSE" name = "zoxide" readme = "README.md" repository = "https://github.com/ajeetdsouza/zoxide" @@ -65,8 +64,6 @@ lto = true strip = true [package.metadata.deb] -section = "admin" -priority = "optional" assets = [ [ "target/release/zoxide", @@ -113,3 +110,5 @@ extended-description = """\ zoxide is a smarter cd command, inspired by z and autojump. It remembers which \ directories you use most frequently, so you can "jump" to them in just a few \ keystrokes.""" +priority = "optional" +section = "admin"