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`.
This commit is contained in:
Max Countryman 2020-07-25 08:05:34 -07:00
parent f053383c71
commit bc9bfaeb84

View file

@ -63,3 +63,16 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
publish-crate:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Set up Rust
uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v2
- name: Publish
shell: bash
run: |
cargo publish --token ${{ secrets.CRATES_TOKEN }}