From bc9bfaeb84d9a04653fe6b8678ea7fa66f1ec424 Mon Sep 17 00:00:00 2001 From: Max Countryman Date: Sat, 25 Jul 2020 08:05:34 -0700 Subject: [PATCH] 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`. --- .github/workflows/rust.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a53e0bab..3fa2aac5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 }}