File tree 1 file changed +49
-0
lines changed
1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 51
51
export PROJECT_TITLE="${{ matrix.os }}"
52
52
bash <(curl -s https://raw.githubusercontent.com/duyet/cov-rs/master/cov.sh)
53
53
54
+ fmt :
55
+ runs-on : ubuntu-latest
56
+ steps :
57
+ - name : Checkout
58
+ uses : actions/checkout@v3
59
+ - uses : actions-rs/toolchain@v1
60
+ with :
61
+ toolchain : nightly
62
+ components : rustfmt
63
+ override : true
64
+ - name : Run fmt check
65
+ run : cargo fmt --all -- --check
66
+
54
67
build :
55
68
runs-on : ${{ matrix.os }}
56
69
strategy :
@@ -118,3 +131,39 @@ jobs:
118
131
with :
119
132
github_token : ${{ secrets.GITHUB_TOKEN }}
120
133
publish_dir : ./target/doc
134
+
135
+ # automate publishing to crates.io on pushes to tags
136
+ publish-crates :
137
+ if : startsWith(github.ref, 'refs/tags/')
138
+ runs-on : ubuntu-latest
139
+ needs : [build, fmt]
140
+ steps :
141
+ - name : Checkout
142
+ uses : actions/checkout@v3
143
+
144
+ - name : Rust Toolchain
145
+ uses : actions-rs/toolchain@v1
146
+ with :
147
+ toolchain : stable
148
+
149
+ - name : Publish
150
+ if : env.CRATES_TOKEN
151
+ run : |
152
+ pushd crate-attributes
153
+ cargo publish --token ${{ secrets.CRATES_TOKEN }}
154
+ popd
155
+ # eventual consistency in crates.io dictates we wait a bit before publishing
156
+ # so that crate-attributes is available for resolution
157
+ sleep 20
158
+ pushd crate
159
+ cargo publish --token ${{ secrets.CRATES_TOKEN }}
160
+ popd
161
+ # eventual consistency in crates.io dictates we wait a bit before publishing
162
+ # so that crate is available for resolution
163
+ sleep 20
164
+ pushd crate-http
165
+ cargo publish --token ${{ secrets.CRATES_TOKEN }}
166
+ popd
167
+ env :
168
+ CRATES_TOKEN : ${{ secrets.CRATES_IO_TOKEN }}
169
+
You can’t perform that action at this time.
0 commit comments