Deploy to GitHub multiple files from multiple Travis jobs on different conditions

I cannot figure out from the documentation how to deploy multiple files from multiple jobs. I have a few jobs that build for different combinations of OS + Compiler + LInkage type (static, or shared). Some jobs produce shell installers, tars, others Debian packages, others RPMs etc. I need to deploy all those different artifacts.
The deploy tag only allows to specify a single condition e.g. condition: ${STATIC_LINK} == 0 && "$TRAVIS_OS_NAME" == "linux". But I need a separate condition for each job to be able to tell travis to deploy DEB package in one job, and RMP package in another.
Something like the following:

deploy:
  file: 
    name: FILE.deb
    condition: $JOB_1
  file:
    name: FILE.rpm
    condition: $JOB_2

A deploy: clause is a part of a job description.

So if you need to deploy at multiple moments, you’ll need to make sure that all relevant jobs have a deploy: clause with an appropriate content, this way or another.

The ways are:

  • A deploy: at global level will be inherited by all jobs.
  • A deploy: at matrix: include: level will be private for the job

The clause cannot be inherited in parts – a job-level clause fully overrides a global one. So you either

  • make a global deploy: clause with a structure general enough to fit all jobs
    • E.g. condition: can have logical ORs; or
  • specify deploy: manually in each affected job which would probably lead to some duplication.

Thanks a lot for this information. Had no idea the ‘deploy’ can be used at matrix:include level. Now I see in the docs one example that hints to it, but it’s very easy to overlook. This solution suits me fine.
As for ‘generic enough’ global condition, I still don’t see how it would be possible to use for deploying different files from different jobs. How would I specify that if CONDITION_1 => deploy INSTALLER.SH, but if CONDITION_2 => deploy INSTALLER.DEB. An example would be greatly appreciated. Although, as I mentioned, the per job deploy is fine with me.
Thanks again

Imprint