Skip to content

Commit

Permalink
chore: automatically publish to Crates.io on release
Browse files Browse the repository at this point in the history
  • Loading branch information
timrogers committed Feb 12, 2024
1 parent 28768c8 commit 2bf82a6
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,30 @@ jobs:
push-to: timrogers/homebrew-tap
create-pullrequest: true
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
publish_on_crates_io:
name: Publish release on Crates.io
runs-on: ubuntu-latest
needs: release
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Install libudev-dev
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: Cache Rust dependencies
uses: actions/[email protected]
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install latest Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustc, cargo
toolchain: nightly
override: true
target: ${{ matrix.job.target }}
- name: Publish to Crates.io
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}

0 comments on commit 2bf82a6

Please sign in to comment.