stages: - test - deploy-dryrun - deploy Build and test Rust code: stage: test image: rustlang/rust:nightly script: - cargo test Test publishing crate: stage: deploy-dryrun image: rustlang/rust:nightly script: - cargo publish --dry-run only: - tags Publish crate: stage: deploy image: rustlang/rust:nightly script: - sh -c 'cargo login "${CARGO_TOKEN}" && cargo publish' only: - tags