Skip to content

Commit 080b625

Browse files
chore: small cleanups
1 parent 683d450 commit 080b625

File tree

8 files changed

+223
-62
lines changed

8 files changed

+223
-62
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
22
bin = ["run", "--package", "cargo-bin", "--"]
3-
cmd = ["bin", "cargo-cmd"]
3+
cmd = ["run", "--package", "cargo-cmd", "--"]
44
deny = ["bin", "cargo-deny"]
55
gha = ["bin", "cargo-gha"]
66
insta = ["bin", "cargo-insta"]

.github/workflows/test.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,33 @@ jobs:
77
name: cargo-run-bin
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions-rs/toolchain@v1
12-
with:
13-
toolchain: stable
14-
- uses: Swatinem/rust-cache@v2
15-
with:
16-
cache-directories: ".bin"
17-
10+
- uses: actions/checkout@v6
1811
- name: Install deps
1912
run: |
20-
cargo bin --build
13+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2114
cargo cmd setup-nightly
15+
cargo deny --help > /dev/null 2>&1
16+
cargo llvm-cov --help > /dev/null 2>&1
17+
cargo nextest --help > /dev/null 2>&1
2218
- name: Lint
2319
run: cargo cmd lint
2420
- name: Test
2521
run: cargo cmd test-coverage-lcov
26-
2722
- name: Coveralls
2823
uses: coverallsapp/github-action@master
2924
with:
3025
github-token: ${{ secrets.GITHUB_TOKEN }}
3126
path-to-lcov: ./lcov.info
3227

33-
test:
28+
test-macos:
3429
name: cargo-run-bin
35-
strategy:
36-
matrix:
37-
os: [macos-latest, windows-latest]
38-
runs-on: ${{ matrix.os }}
30+
runs-on: macos-latest
3931
steps:
40-
- uses: actions/checkout@v2
41-
- uses: actions-rs/toolchain@v1
42-
with:
43-
toolchain: stable
44-
- uses: Swatinem/rust-cache@v2
45-
with:
46-
cache-directories: ".bin"
32+
- uses: actions/checkout@v6
4733
- name: Install deps
4834
run: |
49-
cargo nextest --help
35+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
36+
cargo nextest --help > /dev/null 2>&1
5037
- name: Test
5138
run: |
5239
cargo build

Cargo.lock

Lines changed: 73 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ exclude = [
1919
"rust-toolchain.toml"
2020
]
2121

22+
[workspace]
23+
members = ["tools/cargo-bin", "tools/cargo-cmd"]
24+
2225
[[bin]]
2326
name = "cargo-bin"
2427
path = "src/main.rs"
@@ -34,7 +37,7 @@ cfg-if = "1.0.0"
3437
clap = { version = "4.3.19", optional = true }
3538
rustversion = "1.0.14"
3639
serde = { version = "1.0.149", features = ["derive"] }
37-
toml = "0.5.9"
40+
toml = "0.8.23"
3841
toml_edit = "0.19.14"
3942
version_check = "0.9.3"
4043
which = "4.4.0"
@@ -45,9 +48,7 @@ cargo-husky = { version = "1.5.0", default-features = false, features = ["user-h
4548
insta = { version = "1.31.0", features = ["yaml"] }
4649

4750
[package.metadata.bin]
48-
cargo-cmd = { version = "0.3.1", locked = true }
4951
cargo-deny = { version = "0.13.5", locked = true }
50-
cargo-gha = { version = "1.0.2", locked = true }
5152
cargo-insta = { version = "1.31.0", locked = true }
5253
cargo-llvm-cov = { version = "0.5.25", locked = true }
5354
cargo-nextest = { version = "0.9.57", locked = true }
@@ -61,15 +62,6 @@ dustinblackman-hello-world = { version = "0.2.1", git = "https://github.com/dust
6162
all-features = false
6263
features = []
6364

64-
[package.metadata.gha]
65-
targets = ["aarch64-apple-darwin"]
66-
67-
[[package.metadata.gha.assets]]
68-
owner_repo = "cli/cli"
69-
tag = "v2.40.1"
70-
binaries = ["gh"]
71-
target_archives = { aarch64-apple-darwin = "gh_{NOVTAG}_macOS_arm64.zip" }
72-
7365
[profile.dev.package.insta]
7466
opt-level = 3
7567

@@ -98,11 +90,14 @@ cargo fix --allow-dirty
9890
cargo +runbin-nightly fmt
9991
'''
10092

101-
get-nightly-name = 'echo runbin-nightly'
10293
setup-nightly = '''
103-
export NIGHTLY=nightly-2023-06-16
104-
rustup toolchain list -v | grep -q "$NIGHTLY" || rustup toolchain install "$NIGHTLY" --force --component llvm-tools-preview rustfmt
105-
rustup toolchain link runbin-nightly "$(rustup toolchain list -v | grep $NIGHTLY | grep '^nightly-' | awk '{print $2}')"
94+
export RIPTIDE_NIGHTLY_VERSION=nightly-2025-12-05
95+
export RIPTIDE_NIGHTLY_NAME=runbin-nightly
96+
97+
if !(rustup toolchain list -v | grep "$RIPTIDE_NIGHTLY_NAME" | grep -q "$RIPTIDE_NIGHTLY_VERSION"); then
98+
rustup toolchain install "$RIPTIDE_NIGHTLY_VERSION" --component llvm-tools-preview rustfmt --force
99+
rustup toolchain link "$RIPTIDE_NIGHTLY_NAME" "$(rustup toolchain list -v | grep $RIPTIDE_NIGHTLY_VERSION | grep '^nightly-' | awk '{print $NF}')"
100+
fi
106101
'''
107102

108103
release = '''set -e
@@ -119,8 +114,8 @@ release = '''set -e
119114
git push --tags
120115
121116
cargo publish
122-
cargo gha gh release create "v$RB_VERSION" --generate-notes
123-
cargo bin git-cliff --latest --strip header | cargo gha gh release edit "v$RB_VERSION" --notes-file -
117+
gh release create "v$RB_VERSION" --generate-notes
118+
cargo bin git-cliff --latest --strip header | gh release edit "v$RB_VERSION" --notes-file -
124119
'''
125120

126121
test-coverage = '''set -e
@@ -146,7 +141,4 @@ test = '''set -e
146141
'''
147142
test-watch = '''set -e
148143
cargo watch -i .cargo -x 'cmd test'
149-
'''
150-
151-
[workspace]
152-
members = ["tools/cargo-bin"]
144+
'''

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 Dustin Blackman
3+
Copyright (c) 2021-2025 Dustin Blackman
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

rust-toolchain.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.75.0"
3-
components = ["rustfmt", "clippy", "llvm-tools-preview"]
2+
channel = "1.91.1"
3+
components = ["rustfmt", "clippy", "llvm-tools-preview"]

tools/cargo-cmd/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "cargo-cmd"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
7+
toml = "=0.8.23"

0 commit comments

Comments
 (0)