Skip to content

Commit 97c2e4c

Browse files
Add release step (#9)
1 parent 9f30214 commit 97c2e4c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,31 @@ jobs:
6868

6969
- name: Run cargo tests
7070
run: cargo test --all-features
71+
72+
check:
73+
if: always()
74+
needs: [test, lint]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Check if all needed jobs succeeded
78+
uses: re-actors/alls-green@release/v1
79+
with:
80+
jobs: ${{ toJSON(needs) }}
81+
82+
release:
83+
needs: [check]
84+
if: "success() && startsWith(github.ref, 'refs/tags/')"
85+
runs-on: ubuntu-latest
86+
environment: release
87+
steps:
88+
- uses: actions/checkout@v2
89+
90+
- name: Install Rust stable
91+
uses: dtolnay/rust-toolchain@stable
92+
93+
- uses: Swatinem/rust-cache@v2
94+
95+
- name: Publish to crates.io
96+
run: cargo publish
97+
env:
98+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)