Skip to content

Commit

Permalink
Fixing release script for first release, adding artifact name to gith…
Browse files Browse the repository at this point in the history
…ub_release script
  • Loading branch information
nehashri committed Sep 25, 2017
1 parent c494b57 commit 724e6d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion build/create_release_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion build/github_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ 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
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 "------------------------------"
Expand Down

0 comments on commit 724e6d3

Please sign in to comment.