74
74
- run : cargo +nightly update -Z minimal-versions
75
75
76
76
- run : cargo check -p cucumber-expressions --no-default-features
77
- ${{ matrix.feature != '<none>'
78
- && format('--features {0}', matrix.feature)
79
- || '' }}
77
+ ${{ ( matrix.feature != '<none>'
78
+ && format('--features {0}', matrix.feature) )
79
+ || '' }}
80
80
env :
81
81
RUSTFLAGS : -D warnings
82
82
@@ -178,8 +178,25 @@ jobs:
178
178
# Releasing #
179
179
# ############
180
180
181
+ release-crate :
182
+ name : Release on crates.io
183
+ if : ${{ startsWith(github.ref, 'refs/tags/v') }}
184
+ needs : ["release-github"]
185
+ runs-on : ubuntu-latest
186
+ steps :
187
+ - uses : actions/checkout@v3
188
+ - uses : actions-rs/toolchain@v1
189
+ with :
190
+ profile : minimal
191
+ toolchain : stable
192
+
193
+ - name : Publish `cucumber-expressions` crate
194
+ run : cargo publish -p cucumber-expressions
195
+ --token ${{ secrets.CRATESIO_TOKEN }}
196
+
181
197
release-github :
182
198
name : Release on GitHub
199
+ if : ${{ startsWith(github.ref, 'refs/tags/v') }}
183
200
needs :
184
201
- clippy
185
202
- feature
@@ -188,47 +205,28 @@ jobs:
188
205
- rustdoc
189
206
- rustfmt
190
207
- test
191
- if : ${{ startsWith(github.ref, 'refs/tags/v') }}
192
208
runs-on : ubuntu-latest
193
209
steps :
194
210
- uses : actions/checkout@v3
195
211
196
212
- name : Parse release version
197
213
id : release
198
- run : echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
199
-
214
+ run : echo ::set-output
215
+ name=version::${GITHUB_REF#refs/tags/v}
200
216
- name : Verify release version matches Cargo manifest
201
- run : >-
202
- test "${{ steps.release.outputs.VERSION }}" \
217
+ run : |
218
+ test "${{ steps.release.outputs.version }}" \
203
219
== "$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f2)"
204
220
205
221
- name : Parse CHANGELOG link
206
222
id : changelog
207
223
run : echo ::set-output
208
- name=LINK::https:// github.com /${{ github.repository }}/blob/v${{ steps.release.outputs.VERSION }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)
224
+ name=link::${{ github.server_url }} /${{ github.repository }}/blob/v${{ steps.release.outputs.version }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.version }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)
209
225
210
226
- uses : softprops/action-gh-release@v1
211
- env :
212
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
213
227
with :
214
- name : ${{ steps.release.outputs.VERSION }}
228
+ name : ${{ steps.release.outputs.version }}
215
229
body : |
216
- [API docs](https://docs.rs/cucumber-expressions/${{ steps.release.outputs.VERSION }})
217
- [Changelog](${{ steps.changelog.outputs.LINK }})
218
- prerelease : ${{ contains(steps.release.outputs.VERSION, '-') }}
219
-
220
- release-crate :
221
- name : Release on crates.io
222
- needs : ["release-github"]
223
- if : ${{ startsWith(github.ref, 'refs/tags/v') }}
224
- runs-on : ubuntu-latest
225
- steps :
226
- - uses : actions/checkout@v3
227
- - uses : actions-rs/toolchain@v1
228
- with :
229
- profile : minimal
230
- toolchain : stable
231
-
232
- - name : Publish `cucumber-expressions` crate
233
- run : cargo publish -p cucumber-expressions
234
- --token ${{ secrets.CRATESIO_TOKEN }}
230
+ [API docs](https://docs.rs/cucumber-expressions/${{ steps.release.outputs.version }})
231
+ [Changelog](${{ steps.changelog.outputs.link }})
232
+ prerelease : ${{ contains(steps.release.outputs.version, '-') }}
0 commit comments