Closed seanprashad closed 5 years ago
Travis docs for GitHub releases uploading contains more details on configuration options.
TODO: Test this on one of my own repos by creating a tag and having Travis build and upload the release.
I haven't forgotten about this - just have my ✋ ✋ tied with other coursework right now
No worries! Thanks for the update.
Hey @SeanPrashad, just wanted to check in and see how this pull request is going.
We were discussing the encrypted API token to enable direct upload of build artifacts to GitHub, and I think we might be better served by defining this kind of credential in the repository settings, especially because it's a value that should probably not be automatically available to forks as only the upstream master
branch should upload build artifacts automatically.
@SeanPrashad let me know what you think the best direction would be, and a name for the env var, I can get it added to the repository settings a lot more quickly than creating & encrypting it before sending to you and it should be available immediately on this pull request so you can test it out.
Sweet - I think the repo setting will be just as good. Can we use GH_TOKEN
for the name? That will replace this:
GH_TOKEN: &GH_TOKEN
script:
secure:
with this:
api_key: `GH_TOKEN`
I'll also beef up the conditional settings for when we are going to deploy by adding repo: 0xazure/supernova
. This means that a release will only get deployed if:
master
0xazure/supernova
0xazure/supernova
(git push --tag origin
). This will trigger a build to deploy artifacts from Travis@0xazure I know testing this patch will be quite tricky which is why I've added you to my fork that is setup with Travis.
I would recommend testing out the following four scenarios:
Pushing new commits directly to master
should trigger a build, resulting in nothing uploaded to GitHub Releases
Pushing new commits into a new branch which should trigger a build, resulting in nothing uploaded to GitHub Releases
Create and push a new tag should trigger a build, resulting in new artifacts uploaded to GitHub Releases
Create and push a new tag whilst on a master
should trigger a build, resulting in new artifacts uploaded to GitHub Releases
Create and push a new tag whilst on a new branch should trigger a build, resulting in new artifacts uploaded to GitHub Releases
Just make sure to leave this branch, issue-17
untouched 😄
Can we use
GH_TOKEN
for the name?
Done, I've added it to the Travis env variables for supernova
.
Agreed with the four scenarios, artifacts should only be uploaded for tagged releases on master
.
Should note that tags don't need to be made on master
as they essentially act as their own "branch".
This means that we can tag any branch, push to GitHub and it'll upload artifacts to GitHub Releases.
See an example here for v.0.0.19
:
Fixes #17: Automatically publish artifacts to GitHub
This PR allows successful Travis builds to publish the
target/release
directory to Github releases for Supernova.