summaryrefslogtreecommitdiffstats
path: root/.builds/rust.yml
blob: 0554e301eab29c130f776a8d9e6ae83ab73b5f25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
image: ubuntu/focal

packages:
  - pkg-config
  - libssl-dev

sources:
  - https://git.sr.ht/~a14m/game-of-life

secrets:
  # RUST CRATES.IO CREDENTIALS
  - 3e602cae-1563-4a6a-ab2a-c782c68bd599

tasks:
  - install: |
      curl https://sh.rustup.rs -sSf | sh -s -- -y
      source $HOME/.cargo/env
      rustup install nightly

  - test: |
      source $HOME/.cargo/env
      cd game-of-life/CLI/rust
      cargo +nightly test

  - lint: |
      source $HOME/.cargo/env
      cd game-of-life/CLI/rust
      cargo fmt -- --check

  - release: |
      set +x
      cd game-of-life/CLI/rust
      REF=`git describe --exact-match --tags HEAD ||:`
      if [[ ! `echo $REF | awk '/^rust\/v.*$/'` ]]; then
        echo "Skipping release step. no matching tag"
        exit 0
      fi
      echo "Publishing release $REF"
      source $HOME/.cargo/env
      cargo build --release
      cargo publish