Skip to content

Commit

Permalink
Add make_latest key for publish_gh_release
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfa-ag committed Dec 18, 2024
1 parent ceca76d commit b0d8724
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions publish_gh_release
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,16 +15,16 @@ 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 \
-H "Accept: application/vnd.github+json" \
--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

0 comments on commit b0d8724

Please sign in to comment.