Merge pull request #227 from carapace-sh/dependabot/cargo/clap_comple… #836
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |