Skip to content

Commit

Permalink
ci: create publish action using cargo-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Stonks3141 authored Feb 5, 2024
1 parent 3fbd1b4 commit b32b115
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish crate
on:
push:
tags:
- '*'

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

0 comments on commit b32b115

Please sign in to comment.