From 724e6d3077eadea508332b2dc3d8f5c5b6b6453e Mon Sep 17 00:00:00 2001 From: nehashri Date: Mon, 25 Sep 2017 15:23:16 +0530 Subject: [PATCH] Fixing release script for first release, adding artifact name to github_release script --- build/create_release_text.rb | 6 +++++- build/github_release.sh | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/create_release_text.rb b/build/create_release_text.rb index 71b2d7dfa..37876043a 100644 --- a/build/create_release_text.rb +++ b/build/create_release_text.rb @@ -30,7 +30,11 @@ uri = URI("https://api.github.com/repos/getgauge/#{repo_name}/releases/latest") timestamp = JSON.parse(Net::HTTP.get(uri))['published_at'] -uri = URI("https://api.github.com/search/issues?q=repo:getgauge/#{repo_name}+closed:>#{timestamp}") +if timestamp.nil? || timestamp.empty? + uri = URI("https://api.github.com/search/issues?q=repo:getgauge/#{repo_name}+state:closed") +else + uri = URI("https://api.github.com/search/issues?q=repo:getgauge/#{repo_name}+closed:>#{timestamp}") +end response = Net::HTTP.get(uri) data = JSON.parse(response) diff --git a/build/github_release.sh b/build/github_release.sh index 969864a0d..0ec4ae2c9 100755 --- a/build/github_release.sh +++ b/build/github_release.sh @@ -20,6 +20,11 @@ if [ -z "$repoName" ]; then exit 1 fi +if [ -z "$artifactName" ]; then + echo "artifactName is not set" + artifactName=$repoName +fi + if [ -z "$GITHUB_TOKEN" ]; then echo "GITHUB_TOKEN is not set" exit 1 @@ -27,7 +32,7 @@ fi go get -v -u github.com/aktau/github-release -version=$(ls $repoName* | head -1 | sed "s/\.[^\.]*$//" | sed "s/$repoName-//" | sed "s/-[a-z]*\.[a-z0-9_]*$//"); +version=$(ls $artifactName* | head -1 | sed "s/\.[^\.]*$//" | sed "s/$artifactName-//" | sed "s/-[a-z]*\.[a-z0-9_]*$//"); echo "------------------------------" echo "Releasing $repoName v$version" echo "------------------------------"