Skip to content

Commit

Permalink
make github release happen on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
xmik committed Feb 1, 2019
1 parent 0f0c7da commit 6df9126
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* fix: resolve relative paths in config object
* fix: allow docker and docker-compose run if WorkDirOuter or IdentityDirOuter does not exist
* make github release happen on CI

### 0.2.0 (2019-Jan-25)

Expand Down
15 changes: 14 additions & 1 deletion ci.gocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pipelines:
- cd image_scripts && ./tasks e2e
- release:
clean_workspace: true
secure_variables:
GITHUB_TOKEN: "AES:9mQGklAskrmLBczL1b/UXQ==:u/Kt5dVTpXlDIOTN7ndS6SId01ryLQK+8OorJS7ZA8EECQvc04daQkLA+gRuzHNg"
approval:
type: manual
jobs:
Expand All @@ -108,4 +110,15 @@ pipelines:
command: bash
arguments:
- -c
- ./tasks release
- ./tasks release
- fetch:
stage: build_unit
job: build_unit
is_file: yes
source: dojo
destination: bin
- exec:
command: bash
arguments:
- -c
- ./tasks release_gh
14 changes: 9 additions & 5 deletions tasks
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case "${command}" in
if [[ -n "$2" ]]; then
next_version="$2"
else
last_version="$(get_last_version_from_changelog ${changelog_file})"
last_version="$(get_last_version_from_whole_changelog ${changelog_file})"
next_version="$(bump_patch_version ${last_version})"
fi
set_version_in_changelog "${changelog_file}" "${next_version}"
Expand All @@ -41,7 +41,7 @@ const DojoVersion = \"${next_version}\"
releaser_log_info "Set version: ${next_version}"
;;
verify_version)
version="$(get_last_version_from_changelog ${changelog_file})"
version="$(get_last_version_from_whole_changelog ${changelog_file})"
if git tag | grep "${version}"; then
releaser_log_error "The version: ${version} was already git tagged"
exit 1
Expand All @@ -58,14 +58,18 @@ const DojoVersion = \"${next_version}\"
releaser_log_info "Version: ${version} verified successfully"
;;
release)
version="$(get_last_version_from_changelog ${changelog_file})"
version="$(get_last_version_from_whole_changelog ${changelog_file})"
git tag "${version}"
git push origin "${version}"
;;
release_gh)
if [ ! -f bin/dojo ]; then echo "dojo binary does not exist"; exit 1; fi
if [ -z "$GITHUB_TOKEN" ]; then echo "GITHUB_TOKEN is unset"; exit 1; fi
ide "./tasks build"
ide --idefile Idefile.nodejs "sudo npm install --global release-it && release-it --verbose"
version="$(get_last_version_from_whole_changelog ${changelog_file})"
git remote add upstream [email protected]:ai-traders/dojo.git
git pull upstream master
git push --tags upstream master
ide --idefile Idefile.nodejs "sudo npm install --global release-it && release-it --verbose --increment=${version} --non-interactive"
;;
generate_release_notes)
version=${2?version not set}
Expand Down

0 comments on commit 6df9126

Please sign in to comment.