Skip to content

Commit d1f8d05

Browse files
authored
fix: restore cargo binstall support (#328)
- adjust the suggested install command in README - ensure the binary executables are included in release assets (affected windows only) - adjust the custom `pkg-url` in Cargo.toml metadata for this monorepo's tag prefixes I also changed the features of clang-installer since they were all related to the conditional bin feature.
1 parent 86cc773 commit d1f8d05

6 files changed

Lines changed: 18 additions & 14 deletions

File tree

.github/workflows/binary-builds.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ jobs:
153153
$tgt = "cpp-linter"
154154
mv "../target/${{ matrix.target }}/release/${tgt}.exe" "./${tgt}.exe"
155155
$arc_name = "${tgt}-${{ matrix.target }}.zip"
156-
tar -a -c -v -f "${arc_name}" ${tgt}.exe LICENSE
156+
tar -a -c -v -f "${arc_name}" "${tgt}.exe" "LICENSE"
157157
158158
$tgt = "clang-tools"
159159
mv "../target/${{ matrix.target }}/release/${tgt}.exe" "./${tgt}.exe"
160160
$arc_name = "${tgt}-${{ matrix.target }}.zip"
161-
tar -a -c -v -f "${arc_name}" ${tgt}.exe LICENSE
161+
tar -a -c -v -f "${arc_name}" "${tgt}.exe" "LICENSE"
162162
- name: Upload cpp-linter artifacts
163163
uses: actions/upload-artifact@v7
164164
with:

.github/workflows/bump-n-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ on:
3232
- patch
3333
- rc
3434

35+
run-name: >-
36+
${{ inputs.package && 'Deploy ' || 'Show Unreleased Changes' }}
37+
${{ inputs.package || '' }}
38+
3539
permissions: {}
3640

3741
jobs:
3842
bump-release:
3943
if: github.event_name == 'workflow_dispatch'
44+
name: Bump ${{ inputs.component }} version of ${{ inputs.package }}
4045
runs-on: ubuntu-latest
4146
steps:
4247
- name: Checkout repository

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353

5454
# C/C++ Linting Package
5555

56-
A package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of
56+
A package for linting C/C++ code with clang-tidy and/or clang-format to collect
57+
feedback provided in the form of
5758

5859
- [x] [thread-comments](#thread-comment)
5960
- [x] [step-summary](#step-summary)
@@ -67,7 +68,8 @@ A package for linting C/C++ code with clang-tidy and/or clang-format to collect
6768
6869
## Install
6970

70-
This package is available in several programming languages (through their respective package managers).
71+
This package is available in several programming languages (through their
72+
respective package managers).
7173

7274
### Rust
7375

@@ -77,7 +79,7 @@ This package is available in several programming languages (through their respec
7779
Install from source code hosted at crates.io:
7880

7981
```text
80-
cargo install cpp-linter
82+
cargo install cpp-linter --features bin
8183
```
8284

8385
Install a pre-compiled binary from GitHub releases:
@@ -175,6 +177,7 @@ To provide feedback (requesting a feature or reporting a bug) please post to
175177

176178
The scripts and documentation in this project are released under the [MIT] license.
177179

178-
As for dependencies (that are redistributed by us in binary form) and their licenses, refer to [THIRD-PARTY LICENSES][other-licenses].
180+
As for dependencies (that are redistributed by us in binary form) and their
181+
licenses, refer to [THIRD-PARTY LICENSES][other-licenses].
179182

180183
[MIT]: https://choosealicense.com/licenses/mit

clang-installer/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ reqwest = { workspace = true, features = ["default-tls"] }
4545
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
4646

4747
[features]
48-
bin = ["clap", "tokio", "anyhow", "colored"]
49-
clap = ["dep:clap"]
50-
tokio = ["dep:tokio"]
51-
anyhow = ["dep:anyhow"]
52-
colored = ["dep:colored"]
48+
bin = ["dep:clap", "dep:tokio", "dep:anyhow", "dep:colored"]
5349

5450
[package.metadata.binstall]
55-
pkg-url = "{ repo }/releases/download/{ name }/v{ version }/{ bin }-{ target }{ archive-suffix }"
51+
pkg-url = "{ repo }/releases/download/clang-installer/v{ version }/{ name }-{ target }{ archive-suffix }"

clang-installer/src/tool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum GetClangVersionError {
5454

5555
/// A enumeration of supported clang tools.
5656
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
57-
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
57+
#[cfg_attr(feature = "bin", derive(clap::ValueEnum))]
5858
pub enum ClangTool {
5959
ClangTidy,
6060
ClangFormat,

cpp-linter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ bench = false
5959
required-features = ["bin"]
6060

6161
[package.metadata.binstall]
62-
pkg-url = "{ repo }/releases/download/{ name }/v{ version }/{ bin }-{ target }{ archive-suffix }"
62+
pkg-url = "{ repo }/releases/download/cpp-linter/v{ version }/{ name }-{ target }{ archive-suffix }"

0 commit comments

Comments
 (0)