Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This pull request enables automated Travis/Github pre-releases for
master
branch.The following configuration proposal deploys
master
branch changes to a Github pre-release tagged asmaster-auto
. Thismaster-auto
tag is reused for each future deploy, preventing tag buildup. Releases are overwritten, preventing release buildup.Why?
A quick look through the project issues reveals a few tickets that could be assisted or avoided with more frequent releases:
Travis CI is capable of deploying anywhere, but since Github releases are already in use it makes sense to keep these artifacts in the same spot.
How?
Releases can be automated by extending the
.travis.yml
file. This pull request includes a few files:.travis.yml
: Implements auto pre-release onmaster
branch changesPLATFORMS
: List of[OS]_[ARCH]
used to create binariesREADME.md
: Updated docsbuild-cross.sh
: A cross-compiler assistant script, used manually and in Travis CIThe
.travis.yml
config contains some notable features:if: NOT tag = master-auto
: Don't need to re-run test & deploy onmaster-auto
tag updates, since they've already been done on the origin branch ofmaster
build-cross.sh
is run with a max of 15 processes to enable simultaneous cross-platform compilation 🚄skip_cleanup: true
: needed to ensurebuilds/*
binaries can be uploaded as part of the releasetarget_commitish: $TRAVIS_COMMIT
: needed to ensure Travis releases with the right commit ID, otherwise releases are made titled "untagged-xxxxx"Example
This proposal was tested on a fork. The output can be previewed at:
The emcniece/checkup/releases page linked here contains some other release naming patterns tested during the development of this feature. They ended up being pretty messy, so the
master-auto
overwrite pattern was chosen.Alternatives
Though this
master-auto
tag update & overwrite pattern reduces tag and release clutter, there are drawbacks: Github doesn't always place this release at the very top of the release list each time it updates. Travis also seems to have the occasional problem with overwriting binaries during the deploy upload process - the release is still made and most binaries are uploaded, but if one upload fails it will not be included in the downloadable assets from the Github release page.These problems can be avoided by making unique tags and releases. This results in a release for each
master
branch commit.To do this, the
.travis.yml
config can be simplified:This will create releases with the name of
$TRAVIS_TAG
, which works out to something like20190505002539-0fa1a97
.A simpler tag could also be used, like
auto-$(git log --format=%h -1)}
.Implementation Preparation
If you like this idea and want to merge, there is some quick credential setup that needs to happen: a Github token must be created and added to the Travis environment variables.
1. Create Github Token
public_repo
scope2. Populate Travis CI ENV
GITHUB_API_KEY
References