Skip to content

Publish crate

Publish crate #2

Workflow file for this run

name: Publish crate
on:
release:
types:
- published
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: '-C debuginfo=0'
jobs:
Publish:
runs-on: ubuntu-latest
environment: crates.io
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-release
env:
CARGO_RELEASE_VERSION: v0.25.4
run: |
url="https://github.com/crate-ci/cargo-release/releases/download/$CARGO_RELEASE_VERSION/cargo-release-$CARGO_RELEASE_VERSION-x86_64-unknown-linux-gnu.tar.gz"
curl -fsSL "$url" | tar -C ~/.cargo/bin -xzT <(echo ./cargo-release)
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Publish crates
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo release --allow-branch main --execute --unpublished --no-tag --no-confirm