Skip to content

Commit 1ea5aae

Browse files
committed
Fix deps include dirs listing and add publishing action
1 parent ed34d39 commit 1ea5aae

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

.github/workflows/publish.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Rust CI/CD
2+
3+
on:
4+
pull_request:
5+
types: [synchronize, opened, reopened]
6+
push:
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
test_job:
12+
runs-on: ubuntu-latest
13+
name: Testing on Pull Request
14+
if: github.event_name == 'pull_request'
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: "Test local rust"
18+
uses: Kristories/[email protected]
19+
20+
publish_crate:
21+
runs-on: ubuntu-latest
22+
name: Publish Crate on New Tag
23+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: stable
29+
override: true
30+
- uses: katyo/publish-crates@v1
31+
with:
32+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

src/install/build_info/build_dependency.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ where
4040
deserializer.deserialize_option(JsonStringOrStringVecVisitor)
4141
}
4242

43+
/// A build dependency.
4344
#[derive(Serialize, Deserialize)]
4445
pub struct BuildDependency {
4546
pub(crate) version: String,
@@ -72,8 +73,8 @@ impl BuildDependency {
7273
self.lib_paths.get(0).map(|x| &**x)
7374
}
7475

75-
pub fn get_include_dir(&self) -> Option<&str> {
76-
self.include_paths.get(0).map(|x| &**x)
76+
pub fn get_include_dirs(&self) -> Vec<&str> {
77+
self.include_paths.iter().map(|x| &**x).collect()
7778
}
7879

7980
pub fn get_binary_dir(&self) -> Option<&str> {

src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ mod util;
55

66
// API
77
pub use build::{BuildCommand, BuildCommandBuilder};
8-
pub use install::{build_info::BuildSettings, BuildPolicy, InstallCommand, InstallCommandBuilder};
9-
pub use package::{PackageCommand, PackageCommandBuilder, ConanPackage};
8+
pub use install::{
9+
build_info::{BuildDependency, BuildInfo, BuildSettings},
10+
BuildPolicy, InstallCommand, InstallCommandBuilder,
11+
};
12+
pub use package::{ConanPackage, PackageCommand, PackageCommandBuilder};

0 commit comments

Comments
 (0)