Skip to content

Commit e0a3b5a

Browse files
committed
feat: add release
1 parent 8428253 commit e0a3b5a

File tree

4 files changed

+135
-2
lines changed

4 files changed

+135
-2
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
# act -P ubuntu-latest=-self-hosted -j release --matrix os:ubuntu-latest
10+
release:
11+
strategy:
12+
matrix:
13+
include:
14+
# - os: ubuntu-latest
15+
- os: ubuntu-24.04
16+
target: x86_64-unknown-linux-gnu
17+
bin: cargo-neat
18+
- os: ubuntu-24.04-arm
19+
target: aarch64-unknown-linux-gnu
20+
bin: cargo-neat
21+
- os: windows-2022
22+
target: x86_64-pc-windows-msvc
23+
bin: cargo-neat.exe
24+
- os: macos-14
25+
target: x86_64-apple-darwin
26+
bin: cargo-neat
27+
- os: macos-14
28+
target: aarch64-apple-darwin
29+
bin: cargo-neat
30+
runs-on: ${{ matrix.os }}
31+
permissions:
32+
contents: write
33+
steps:
34+
- uses: actions/checkout@v6
35+
- uses: dtolnay/rust-toolchain@stable
36+
with:
37+
toolchain: stable
38+
target: ${{ matrix.target }}
39+
- name: Release build
40+
run: cargo build --release --target ${{ matrix.target }} --features=openssl
41+
- name: Package
42+
shell: bash
43+
run: |
44+
name=cargo-neat
45+
tag=$(git describe --tags --abbrev=0)
46+
release_name="$name-$tag-${{ matrix.target }}"
47+
release_tar="${release_name}.tar.gz"
48+
mkdir "$release_name"
49+
if [ "${{ matrix.target }}" != "x86_64-pc-windows-msvc" ]; then
50+
strip "target/${{ matrix.target }}/release/${{ matrix.bin }}"
51+
fi
52+
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/"
53+
cp README.md LICENSE-* "$release_name/"
54+
tar czvf "$release_tar" "$release_name"
55+
rm -r "$release_name"
56+
# Windows environments in github actions don't have the gnu coreutils installed,
57+
# which includes the shasum exe, so we just use powershell instead
58+
if [ "${{ matrix.target }}" == "x86_64-pc-windows-msvc" ]; then
59+
echo "(Get-FileHash \"${release_tar}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_tar}.sha256\"" | pwsh -c -
60+
else
61+
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256"
62+
fi
63+
- name: Publish
64+
uses: softprops/action-gh-release@v2
65+
with:
66+
files: "cargo-neat*"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.1.1] - 2025-12-29
8+
### Added
9+
- Add github pre-built binaries and release
10+
711
## [0.1.0] - 2025-12-26
812
### Added
913
- Initial version

Cargo.lock

Lines changed: 53 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["killzoner"]
33
edition = "2024"
44
name = "cargo-neat"
55
resolver = "3"
6-
version = "0.1.0"
6+
version = "0.1.1"
77

88
description = "A tool to complement cargo-machete and remove unused workspace dependencies"
99
documentation = "https://docs.rs/cargo-neat"
@@ -16,6 +16,9 @@ anyhow = { version = "1.0.100", default-features = false }
1616
argh = { version = "0.1.13", default-features = false, features = ["help"] }
1717
cargo = { version = "0.93.0", default-features = true }
1818
log = { version = "0.4.29", default-features = false }
19+
openssl = { version = "0.10.75", default-features = false, optional = true, features = [
20+
"vendored",
21+
] }
1922
pretty_env_logger = { version = "0.5.0", default-features = false }
2023
termtree = { version = "0.5.1", default-features = false }
2124

@@ -25,6 +28,14 @@ trycmd = { version = "0.15.11", default-features = false, features = [
2528
"diff",
2629
] }
2730

31+
[features]
32+
openssl = [
33+
"dep:openssl",
34+
] # this feature is not used, but necessary for build using cargo library
35+
36+
[package.metadata.cargo-machete]
37+
ignored = ["openssl"]
38+
2839
# optimized cargo wizard profile for MinSize
2940
[profile.release]
3041
codegen-units = 1

0 commit comments

Comments
 (0)