Skip to content

Commit

Permalink
ci(workflow): add publish-crates job
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Dec 13, 2024
1 parent 1ff230c commit c8528e8
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish

on:
push:
branches: [main]
tags: ["v*"]

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: true

jobs:
publish-crates:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75
default: true
override: true

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Publish crates to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo make publish-crates

0 comments on commit c8528e8

Please sign in to comment.