image: "rust:latest" stages: - test - deploy variables: CARGO_HOME: $CI_PROJECT_DIR/.cargo .cached: &cached cache: key: $CI_COMMIT_REF_NAME untracked: true paths: - target/ - .cargo/ .test_job: &test_job <<: *cached environment: test stage: test .deploy_job: &deploy_job <<: *cached environment: deploy stage: deploy test:rust-stable: <<: *test_job script: - cargo test --all deploy:crates-io: <<: *deploy_job script: - cargo publish --token $CRATES_IO_API_TOKEN only: - tags@valeth/discord-rpc-client.rs