Skip to content

fix: Update dependencies #82

fix: Update dependencies

fix: Update dependencies #82

name: Build, test & release
on:
push:
branches:
- main
pull_request: {}
env:
APP_NAME: samling
jobs:
clippy:
name: Check for common code mistakes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run clippy
continue-on-error: true
run: cargo clippy -- -D warnings
fmt:
name: Check code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run rustfmt
continue-on-error: true
run: cargo fmt --all -- --check
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --release
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: jacobsvante/cargo-deny-action@v1
create-release-pr:
name: Conditionally create release PR
needs: [clippy, cargo-deny, test]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: write
pull-requests: write
steps:
- name: Create a release Pull Request
uses: googleapis/release-please-action@v4
with:
skip-github-release: true
publish:
name: Conditionally publish to crates.io
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: write
pull-requests: write
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Make cargo command available
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Ensure publishable
run: cargo publish --dry-run
- uses: googleapis/release-please-action@v4
id: release
with:
skip-github-pull-request: true
token: ${{ secrets.EVENT_TRIGGERING_GITHUB_TOKEN }}
- name: Tag major and minor versions in Git
if: ${{ steps.release.outputs.release_created }}
uses: jacobsvante/tag-major-minor-action@v0
with:
major: ${{ steps.release.outputs.major }}
minor: ${{ steps.release.outputs.minor }}
- if: ${{ steps.release.outputs.release_created }}
run: cargo publish