summaryrefslogtreecommitdiffstats
path: root/.builds/ruby.yml
blob: aeb97bc6be2e4ac338d964fa7e14b5980b9914e4 (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
image: alpine/latest

packages:
  - ruby
  - ruby-dev
  - ruby-bundler

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

secrets:
  # RUBY GEMS CREDENTIALS
  - 3bf42fd4-1985-48db-8790-1f61cde29671

tasks:
  - build: |
      cd game-of-life/CLI/ruby
      bundle install -j $(nproc)

  - test: |
      cd game-of-life/CLI/ruby
      bundle exec rspec --format progress

  - lint: |
      cd game-of-life/CLI/ruby
      bundle exec rubocop

  - release: |
      set +x
      cd game-of-life/CLI/ruby
      REF=`git describe --exact-match --tags HEAD ||:`
      if [[ ! `echo $REF | awk '/^ruby\/v.*$/'` ]]; then
        echo "Skipping release step. no matching tag"
        exit 0
      fi
      echo "Publishing release $REF"
      bundle exec rake clean
      bundle exec rake clobber
      bundle exec rake build
      bundle exec gem push pkg/terminal_game_of_life-*.gem