stages: - check - test - release default: image: rust:1.93 cache: key: "$CI_COMMIT_REF_SLUG" paths: - target - .cargo/registry - .cargo/git check: stage: check script: - cargo fmt --all -- --check - cargo clippy --all-targets --all-features -- -D warnings only: - branches - tags test: stage: test script: - cargo test --all needs: - check only: - branches - tags release: stage: release needs: - test # Only run on tags starting with "v" rules: - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' script: - cargo build --release - mkdir -p dist - cp target/release/oreilly-epub dist/oreilly-epub-linux-x86_64 artifacts: name: "oreilly-epub-$CI_COMMIT_TAG-linux-x86_64" paths: - dist/oreilly-epub-linux-x86_64 expire_in: 1 week