### ----------------------------------------------------
### -- SparrowCI
### -- Licenses: Artistic-2.0
### -- Authors: Alexey Melezhik
### -- File: sparrow.yaml
### ----------------------------------------------------
image:
  - melezhik/sparrow:debian_arm

secrets:
  - FEZ_TOKEN
tasks:
  -
    name: test
    default: true
    if:
      language: Raku
      code: |
        if %*ENV<SCM_COMMIT_MESSAGE> ~~ /'skip_ci'/ {
          update_state %( status => 'skip' );
          say "CI skipped";
        }
    followup:
      -
        name: release
    language: Bash
    code: |
      set -e
      env|grep SCM
      sudo apt-get update
      sudo apt-get install -y libarchive13 libcurl4-openssl-dev > /dev/null
      cd source
      zef install --/test \
        https://github.com/bduggan/p6-digest-sha1-native/archive/refs/tags/0.05.tar.gz
      zef install Pakku --/test
      pakku nobar add noprecomp notest to home .
      #zef install --/test .
  -
    name: release
    if:
      language: Raku
      code: |
        unless %*ENV<SCM_COMMIT_MESSAGE> ~~ /'release!'/ {
          update_state %( status => 'skip' )
        }
    language: Bash
    code: |
      set -e
      zef install --/test fez

      cat << HERE > ~/.fez-config.json
       {
          "groups":[],"un":"melezhik","key":"$FEZ_TOKEN",
          "bundlers": ["Fez::Util::Pax"]
       }
      HERE

      cd source/

      tom --clean
      fez -v
      fez upload --unattended


