Skip to content

Instantly share code, notes, and snippets.

@simogasp
Created January 15, 2018 17:16
Show Gist options
  • Save simogasp/db28b23c6c15dfd4a76c732f63551280 to your computer and use it in GitHub Desktop.
Save simogasp/db28b23c6c15dfd4a76c732f63551280 to your computer and use it in GitHub Desktop.
Setting up Travis deploy

Setting up Travis deploy

  1. Create an OAuth token from your profile settings
  • under Developer select Personal access token
  • generate a new one and copy it to the clipboard
  1. On the travis page of the repository, go to settings --> More Options->Settings
  2. Set a new Environment Variable called eg GITHUB_RELEASE_API_KEY or whatever u like, and copy the key
  3. In the .travis.yaml file, under add something like that
before_deploy:
  - ARCHIVE_BASE_PATH=${INSTALL_DIR}
  - TARGET_VERSION=$(echo ${TRAVIS_TAG} | cut -d "v" -f2)
  - TARGET_FULL_NAME=${TARGET_NAME}-${TARGET_VERSION}-${CC}-${TRAVIS_OS_NAME}
  - INSTALL_ARCHIVE_FILENAME=${TARGET_FULL_NAME}.tgz
  - cd ${INSTALL_DIR}
  - tar -czvf ${INSTALL_ARCHIVE_FILENAME} ${TARGET_NAME}

deploy:
  provider: releases
  api_key:
    secure: ${GITHUB_RELEASE_API_KEY}
  file: ${ARCHIVE_BASE_PATH}/${INSTALL_ARCHIVE_FILENAME}
  skip_cleanup: true
  on:
    tags: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment