diff --git a/publish_gh_release b/publish_gh_release index d4b85a65..6ddbefa0 100755 --- a/publish_gh_release +++ b/publish_gh_release @@ -1,6 +1,7 @@ #!/bin/bash # Creates a new Github release with the current version and changelog PRERELEASE=false +LATEST=false BRANCH=$(git symbolic-ref --short HEAD) VERSION=$(sed -nr 's/mod_version=(.*)/\1/p' gradle.properties) if [ $? -ne 0 ] || [ -z "$VERSION" ]; then @@ -14,9 +15,9 @@ fi echo "Publishing Github release '$VERSION' on branch '$BRANCH'" -export PRERELEASE BRANCH VERSION +export PRERELEASE BRANCH VERSION LATEST curl -L \ - --variable '%BRANCH' --variable '%VERSION' --variable '%PRERELEASE' \ + --variable '%PRERELEASE' --variable '%BRANCH' --variable '%VERSION' --variable '%LATEST' \ --variable '%GH_TOKEN@../totemic_gh_token' \ --variable '%CHANGELOG@changelog.md' \ -X POST \ @@ -24,6 +25,6 @@ curl -L \ --expand-header "Authorization: Bearer {{GH_TOKEN:trim}}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/TeamTotemic/Totemic/releases \ - --expand-data '{"tag_name":"{{VERSION:json}}","target_commitish":"{{BRANCH:json}}","name":"{{VERSION:json}}","body":"{{CHANGELOG:json}}","draft":false,"prerelease":{{PRERELEASE}},"generate_release_notes":false}' + --expand-data '{"tag_name":"{{VERSION:json}}","target_commitish":"{{BRANCH:json}}","name":"{{VERSION:json}}","body":"{{CHANGELOG:json}}","draft":false,"prerelease":{{PRERELEASE}},"generate_release_notes":false,"make_latest":"{{LATEST}}"}' git fetch --tags