Skip to content

Commit

Permalink
Merge pull request #2 from iqm-finland/COMP-404-CLI
Browse files Browse the repository at this point in the history
Fix tag-from-pipeline bash script
  • Loading branch information
freetonik authored Jul 13, 2022
2 parents 615f82a + ff3a5c5 commit ea2cdc6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tag-from-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ function verify_changelog_version() {
fi
if [ $(git tag -l "$version") ]; then
printf "Version %s already exists.\n" "$version";
return 172
fi
printf "Current version is %s, new version is %s.\n" "$current_version" "$version";
}

function create_new_tag() {
Expand All @@ -43,7 +45,8 @@ function create_new_tag() {
# Only tag if version doesn't exist yet
if ! [ $(git tag -l "$version") ]; then
printf "Releasing version %s.\n" "$version"
curl --request POST --header "PRIVATE-TOKEN: $PROJECT_TOKEN_PIPELINE" "https://gitlab.iqm.fi/api/v4/projects/${CI_PROJECT_ID}/repository/tags?tag_name=${version}&ref=master" -f
curl -X POST -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases" \
-d "{\"tag_name\": \"$version\", \"name\": \"$version\", \"body\": \"Changelog: https://github.com/$GITHUB_REPOSITORY/blob/main/CHANGELOG.rst\"}"
fi
}

Expand Down

0 comments on commit ea2cdc6

Please sign in to comment.