31

I have created a simple travis configuration which packages an app and tries to deploy the archive file to github. The problem is, I would like to have the version number part of the file name, so i require to use a pattern for the filename. I simply can't get it to work.

Configuration is currently:

deploy:
  provider: releases
  file: "build/distributions/worktrail-app-hub-sync*.zip"
  on:
    repo: worktrail/worktrail-app-hub-sync
    tags: true
    all_branches: true

But it fails with: "/home/travis/.rvm/gems/ruby-1.9.3-p547/gems/octokit-3.3.1/lib/octokit/client/releases.rb:86:in `initialize': No such file or directory - build/distributions/worktrail-app-hub-sync*.zip (Errno::ENOENT)" - but the file is certainly there: build/distributions/worktrail-app-hub-sync-0.0.1.zip

Example run: https://travis-ci.org/worktrail/worktrail-app-hub-sync/builds/35704111 travis.yml: https://github.com/worktrail/worktrail-app-hub-sync/blob/0.0.1/.travis.yml

Is this supported by travis deployment, or is there any workaround for this use case?

Herbert Poul
  • 4,512
  • 2
  • 31
  • 48

3 Answers3

41

Wildcards are supported by now if you enable the file_glob option. This is how I deploy a build .deb file to GitHub releases:

before_deploy:
  - export RELEASE_PKG_FILE=$(ls *.deb)
  - echo "deploying $RELEASE_PKG_FILE to GitHub releases"
deploy:
  provider: releases
  api_key:
    secure: YOUR_ENCRYPTED_API_KEY
  file_glob: true
  file: "${RELEASE_PKG_FILE}"
  on:
    tags: true

Setting up is easy by executing travis setup releases with a dummy filename and modifying .travis.yml afterwards.

Jakob
  • 3,570
  • 3
  • 36
  • 49
12
deploy:
  file_glob: true
  file: "build/distributions/worktrail-app-hub-sync*.zip"

example

user2673683
  • 176
  • 1
  • 2
2

Sorry, wildcard patterns don't work at the moment, but we'll have a look into making that possible on Travis CI.

roidrage
  • 2,341
  • 17
  • 17