chbs 0.0.8

A crate providing secure passphrase generation based on a wordlist
Documentation
image: "rust:slim"

stages:
  - check
  - build
  - release

variables:
  RUST_VERSION: stable

# Install the proper Rust compiler version
before_script:
  - |
    rustup install $RUST_VERSION
    rustup default $RUST_VERSION
  - |
    rustc --version
    cargo --version

# Variable defaults
variables:
  RUST_VERSION: stable

# Check on stable, beta and nightly 
.check-base: &check-base
  stage: check
  script:
    - cargo check --verbose
    - cargo test --verbose
rust-stable:
  <<: *check-base
rust-beta:
  <<: *check-base
  variables:
    RUST_VERSION: beta
rust-nightly:
  <<: *check-base
  variables:
    RUST_VERSION: nightly

# Build using Rust stable
build:
  stage: build
  script:
    - cargo build --release --verbose

# Cargo crate release
crate:
  stage: release
  only:
    - /^v(\d+\.)*\d+$/
  script:
    - echo "Creating release crate to publish on crates.io..."
    - echo $CARGO_TOKEN | cargo login
    - echo "Publishing crate to crates.io..."
    - cargo publish --verbose