2

What I'm looking for is something that builds C++ code every night or on every commit, and then, crucially, runs some commands to create a zip or a package which can then be added to a "Release" on GitHub.

I know there's travis-CI, which automatically compiles commits, and it can run for example a CMake INSTALL target and then CPack, which would create a zip or installer package. But it's not possible to upload these files to GitHub or display them somewhere.

I was thinking that maybe there was another service for that available which integrates with GitHub, but couldn't find any Google hits whatsoever. Preferably this would be separate from travis-CI, since on travis you would run debug-like builds (static analysers etc.). While for a release you want to deploy, you'd put release flags, build documentation, etc.

This is for an open source project so I'm looking for something that does this free for open source projects, preferably without setting up own server infrastructure.

There are a few related posts like Travis-CI Auto-Tag Build for GitHub Release or a travis section on deployment but they haven't really answered my question.

Community
  • 1
  • 1
Ela782
  • 5,041
  • 5
  • 53
  • 66
  • If you have the resources to dedicate to it, could you just use `cron` and a well done shell script? – druckermanly Dec 04 '16 at 20:51
  • @user2899162: Your solution needs a web-facing server that you need to maintain yourself (and pay), right? I would like to avoid that. – Ela782 Dec 04 '16 at 20:54
  • After reading Chris's comment I found that as well, thanks! The same is possible with AppVeyor: https://www.appveyor.com/docs/deployment/github/ They even support creating "Draft" releases, so you can double-check everything before making the release public. Travis's doc doesn't say if that's possible. But I really wonder whether this solution is good: E.g. what happens if travis and appveyor both try to create a release, and it already exists (one of them was first?) I'm very much interested in other solutions too! – Ela782 Dec 04 '16 at 21:05
  • `Preferably this would be separate from travis-CI, since on travis you would run debug-like builds (static analysers etc.).` So, I guess that's not how most people think about travis right now. Lots of projects build debug and release on travis and run the tests both ways, since UB can manifest in only one build or only the other. I think what you are looking for is simply CI -- there's not going to be one kind of CI service aimed at debug, and one aimed at release. If you can build people's C++ projects you can do it all -- tests, deployment, documentation, whatever. – Chris Beck Dec 04 '16 at 21:44
  • If you don't like travis support for build artifacts / nightlies, I guess you could look at another CI service like circle-CI, or consider running your own jenkins server, but then you need to host it somewhere. – Chris Beck Dec 04 '16 at 21:45
  • Jenkins looks pretty amazing! Too bad they don't offer hosting for open-source projects! – Ela782 Dec 04 '16 at 21:59

1 Answers1

2

You can use travis-CI for this, check out "build artifacts" in the documentation.

https://docs.travis-ci.com/user/deployment/releases/

At time of writing it looks like this:

GitHub Releases Uploading

Travis CI can automatically upload assets from your $TRAVIS_BUILD_DIR to your git tags on your GitHub repository.

Please note that deploying GitHub Releases works only for tags, not for branches.

For a minimal configuration, add the following to your .travis.yml:

deploy:
  provider: releases
  api_key: "GITHUB OAUTH TOKEN"
  file: "FILE TO UPLOAD"
  skip_cleanup: true
  on:
    tags: true

Basically you would have to tag each commit that you want to get uploaded, so you could make a cron job that does that regularly, or do it manually, only on days that interesting work happened.

Alternatively, you could make it upload all builds to a google cloud storage account, or an amazon s3 account, and then you can cron job it from there. See docs for instance here.

Chris Beck
  • 15,614
  • 4
  • 51
  • 87
  • I'll accept this answer - it's probably the best and easiest thing to do. This (and AppVeyor), or Jenkins, seems to be the only available solutions, and Jenkins is unfortunately not available for free for FOSS projects. It's all not perfect but it'll have to do. Thanks for your answer! – Ela782 Dec 08 '16 at 16:06