Skip to content

Commit 05f95c3

Browse files
committed
fix docs build
1 parent 4f6f3f1 commit 05f95c3

File tree

6 files changed

+66
-6
lines changed

6 files changed

+66
-6
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515

1616
jobs:
1717
test:
18+
name: test ${{ matrix.channel }}-${{ matrix.target }}
1819
runs-on: ${{ matrix.os }}
1920
steps:
2021
- uses: actions/checkout@v4
@@ -46,6 +47,11 @@ jobs:
4647
log-level: warn
4748
command: check
4849
arguments: --all-features
50+
- name: Build Docs
51+
uses: actions-rs/cargo@v1
52+
with:
53+
command: doc
54+
args: --all
4955
- name: Run tests
5056
env:
5157
CHANNEL: ${{ matrix.channel }}

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release Crates
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
pull_request:
8+
branches:
9+
- master
10+
paths:
11+
- ".github/workflows/release.yml"
12+
workflow_dispatch:
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
publish:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
# Publish package one by one instead of flooding the registry
22+
max-parallel: 1
23+
matrix:
24+
# Order here is sensitive, as it will be used to determine the order of publishing
25+
package:
26+
- "core"
27+
- "hook"
28+
- "macros"
29+
- "open-coroutine"
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Setup Rust toolchain
33+
uses: actions-rs/toolchain@v1
34+
with:
35+
toolchain: stable
36+
- name: Dryrun ${{ matrix.package }}
37+
working-directory: ${{ matrix.package }}
38+
run: cargo publish --dry-run
39+
- name: Publish ${{ matrix.package }}
40+
working-directory: ${{ matrix.package }}
41+
# Only publish if it's a tag and the tag is not a pre-release
42+
if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
43+
run: cargo publish
44+
env:
45+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
]
99

1010
[workspace.package]
11-
version = "0.6.14"
11+
version = "0.6.15"
1212
edition = "2021"
1313
authors = ["[email protected]"]
1414
repository = "https://github.com/acl-dev/open-coroutine"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn main() {
136136
}
137137
```
138138

139-
## 🪽 Advanced Usage
139+
## 👊 Advanced Usage
140140

141141
### create a task with priority
142142

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn main() {
132132
}
133133
```
134134

135-
## 🪽 进阶使用
135+
## 👊 进阶使用
136136

137137
### 创建具有优先级的任务
138138

open-coroutine/build.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ fn main() {
8181
);
8282
let crates_parent = if crates_parent_dirs.len() == 1 {
8383
crates_parent_dirs.first().expect("host dir not found")
84-
} else {
85-
let rustup_dist_server =
86-
var("RUSTUP_DIST_SERVER").expect("RUSTUP_DIST_SERVER not found");
84+
} else if let Ok(rustup_dist_server) = var("RUSTUP_DIST_SERVER") {
8785
let host = rustup_dist_server
8886
.split("://")
8987
.last()
@@ -109,6 +107,17 @@ fn main() {
109107
})
110108
.expect("host dir not found")
111109
})
110+
} else {
111+
crates_parent_dirs
112+
.iter()
113+
.find(|entry| {
114+
entry
115+
.file_name()
116+
.to_string_lossy()
117+
.to_string()
118+
.contains("crates.io")
119+
})
120+
.expect("host dir not found")
112121
}
113122
.file_name()
114123
.to_string_lossy()

0 commit comments

Comments
 (0)