File tree Expand file tree Collapse file tree 5 files changed +66
-5
lines changed Expand file tree Collapse file tree 5 files changed +66
-5
lines changed Original file line number Diff line number Diff line change 1515
1616jobs :
1717 test :
18+ name : test ${{ matrix.channel }}-${{ matrix.target }}
1819 runs-on : ${{ matrix.os }}
1920 steps :
2021 - uses : actions/checkout@v4
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 }}
Original file line number Diff line number Diff line change 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+ jobs :
15+ publish :
16+ runs-on : ubuntu-latest
17+ strategy :
18+ # Publish package one by one instead of flooding the registry
19+ max-parallel : 1
20+ matrix :
21+ # Order here is sensitive, as it will be used to determine the order of publishing
22+ package :
23+ - " core"
24+ - " hook"
25+ - " macros"
26+ - " open-coroutine"
27+ steps :
28+ - uses : actions/checkout@v4
29+ - name : Setup Rust toolchain
30+ uses : actions-rs/toolchain@v1
31+ with :
32+ toolchain : stable
33+ - name : Update version in Cargo.toml
34+ run : |
35+ VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
36+ sed -i "s/^version = .*/version = \"$VERSION\"/" ${{ github.workspace }}/Cargo.toml
37+ - name : Dryrun ${{ matrix.package }}
38+ working-directory : ${{ matrix.package }}
39+ run : cargo publish --dry-run
40+ - name : Publish ${{ matrix.package }}
41+ working-directory : ${{ matrix.package }}
42+ # Only publish if it's a tag and the tag is not a pre-release
43+ if : ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
44+ run : cargo publish
45+ env :
46+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ fn main() {
132132}
133133```
134134
135- ## 🪽 进阶使用
135+ ## 👊 进阶使用
136136
137137### 创建具有优先级的任务
138138
Original file line number Diff line number Diff 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 ( )
You can’t perform that action at this time.
0 commit comments