Skip to content

Commit 7e92c41

Browse files
committed
Adjust CI pipeline codestyle
1 parent aad409f commit 7e92c41

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
7474
- run: cargo +nightly update -Z minimal-versions
7575

7676
- 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+
|| '' }}
8080
env:
8181
RUSTFLAGS: -D warnings
8282

@@ -178,8 +178,25 @@ jobs:
178178
# Releasing #
179179
#############
180180

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+
181197
release-github:
182198
name: Release on GitHub
199+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
183200
needs:
184201
- clippy
185202
- feature
@@ -188,47 +205,28 @@ jobs:
188205
- rustdoc
189206
- rustfmt
190207
- test
191-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
192208
runs-on: ubuntu-latest
193209
steps:
194210
- uses: actions/checkout@v3
195211

196212
- name: Parse release version
197213
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}
200216
- name: Verify release version matches Cargo manifest
201-
run: >-
202-
test "${{ steps.release.outputs.VERSION }}" \
217+
run: |
218+
test "${{ steps.release.outputs.version }}" \
203219
== "$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f2)"
204220
205221
- name: Parse CHANGELOG link
206222
id: changelog
207223
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)
209225

210226
- uses: softprops/action-gh-release@v1
211-
env:
212-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213227
with:
214-
name: ${{ steps.release.outputs.VERSION }}
228+
name: ${{ steps.release.outputs.version }}
215229
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

Comments
 (0)