Skip to content

Merge pull request #227 from carapace-sh/dependabot/cargo/clap_comple… #836

Merge pull request #227 from carapace-sh/dependabot/cargo/clap_comple…

Merge pull request #227 from carapace-sh/dependabot/cargo/clap_comple… #836

Workflow file for this run

name: Rust
on:
pull_request:
push:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: shallow clone
uses: actions/checkout@v4
- name: deep clone
uses: actions/checkout@v4
if: startsWith(github.ref, 'refs/tags/v')
with:
fetch-depth: 0
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish crate
if: startsWith(github.ref, 'refs/tags/v')
run: sed -i "s_0.1.0-PLACEHOLDER_${GITHUB_REF/refs\/tags\/v/}_" Cargo.toml && cargo publish --token ${CRATES_TOKEN} --allow-dirty
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}