Skip to content

Commit bc9bfae

Browse files
committed
automate crate publishing
This introduces a new section of the GitHub Actions workflow which will publish the crate upon a new tag being pushed. Note that this requires a new project secret, `CRATES_TOKEN`.
1 parent f053383 commit bc9bfae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/rust.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,16 @@ jobs:
6363
uses: coverallsapp/github-action@master
6464
with:
6565
github-token: ${{ secrets.GITHUB_TOKEN }}
66+
67+
publish-crate:
68+
if: startsWith(github.ref, 'refs/tags/')
69+
runs-on: ubuntu-latest
70+
needs: [test]
71+
steps:
72+
- name: Set up Rust
73+
uses: hecrj/setup-rust-action@v1
74+
- uses: actions/checkout@v2
75+
- name: Publish
76+
shell: bash
77+
run: |
78+
cargo publish --token ${{ secrets.CRATES_TOKEN }}

0 commit comments

Comments
 (0)