-
Notifications
You must be signed in to change notification settings - Fork 80
Enable automatic releases #60
Conversation
scripts/release.sh
Outdated
| fi | ||
|
|
||
| origin=`git config --get remote.origin.url` | ||
| if [[ "$origin" != "https://github.com/$REPO_DOMAIN/$REPO_NAME" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this check necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is also TRAVIS_REPO_SLUG: The slug (in form: owner_name/repo_name) of the repository currently being built.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need it to avoid triggering releases from my fork.
Did't find the TRAVIS_REPO_SLUG, good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, it shouldn't be running in your fork if you disable builds for it. Also the ACCESS_TOKEN should not be available in yours or anyone else's fork for this to actually release anything if it is enabled. This isn't a check you usually find in travis build files because it generally isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use the builds in my fork to early discover errors. I am not sure of how secrets work I know that is not usable in any repository but the one configured but I don't know what is its value in my fork, that's why I didn't use it for the check. I guess it is not set in that case, I will check that.
| @@ -1,6 +1,6 @@ | |||
| { | |||
| "name": "serverless-kubeless", | |||
| "version": "0.1.11", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a way to update version automatically with ${TRAVIS_TAG} env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that TRAVIS_TAG is available in the builds triggered by a new tag. These scripts are meant to generate that tag so the environment variable is not available yet.
scripts/release.sh
Outdated
| # Parse relase notes like an list (e.g): | ||
| # - 12345abcd Merge pull request #1 Title | ||
| # - 12345efgh commit included 1 | ||
| # - 12345hijk commit included 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment lines
| #!/bin/bash | ||
| set -e | ||
|
|
||
| function get_version { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ you can consider to use ${TRAVIS_TAG}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see other comment)
This diff enable automatic releases for new versions. Once a new version is detected a release is created in Github and the version is published in the NPM registry.
Example of a Github release: https://github.com/andresmgot/serverless-kubeless/releases/tag/v0.1.12