box:
  id: octoblu/arm-node-compile
  cmd: /bin/bash
build:
  steps:
    - script:
        name: get-latest-tags
        code: |
          mkdir -p ~/.ssh
          echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
          sed -i'' -e 's/git@github.com:/https:\/\/github.com\//' .git/config
          git fetch
    - script:
        name: save-version
        code: |
          echo "$(git describe --tags)" > "${WERCKER_OUTPUT_DIR}/VERSION"
          echo "VERSION: $(cat "${WERCKER_OUTPUT_DIR}/VERSION")"
    - script:
        name: compile
        code: |
          compile "$WERCKER_SOURCE_DIR" "$WERCKER_OUTPUT_DIR"
          mv "${WERCKER_OUTPUT_DIR}/app-linux-arm.tar.gz" "${WERCKER_OUTPUT_DIR}/skype-linux-arm.tar.gz"
    # - internal/store-container
deploy:
  steps:
    - script:
        name: upload to github
        code: |
          echo "Releasing: $(cat "${WERCKER_ROOT}/VERSION")"
          github-release upload \
            --user octoblu \
            --repo meshblu-connector-skype \
            --tag "$(cat "${WERCKER_ROOT}/VERSION")" \
            --name "skype-linux-arm.tar.gz" \
            --file "${WERCKER_ROOT}/skype-linux-arm.tar.gz"
