Skip to content

Commit

Permalink
tweak update versions [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhotio committed Feb 12, 2024
1 parent acc1233 commit 6de9caf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions update-versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash
old_version=$(jq -re '.version' < VERSION.json)
version=$(curl -u "${GITHUB_ACTOR}:${GITHUB_TOKEN}" -fsSL "https://api.github.com/repos/stashapp/stash/releases/latest" | jq -re .tag_name) || exit 1
json=$(cat VERSION.json)
jq --sort-keys \
--arg version "${version//v/}" \
'.version = $version' <<< "${json}" | tee VERSION.json
if [[ "${version}" != "v${old_version}" ]]; then
curl -fsSL "https://github.com/stashapp/stash/releases/download/${version}/stash-linux" -o /dev/null || exit 1
json=$(cat VERSION.json)
jq --sort-keys \
--arg version "${version//v/}" \
'.version = $version' <<< "${json}" | tee VERSION.json
fi

0 comments on commit 6de9caf

Please sign in to comment.