File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ old_version=$( jq -re ' .version' < VERSION.json)
2
3
version=$( curl -u " ${GITHUB_ACTOR} :${GITHUB_TOKEN} " -fsSL " https://api.github.com/repos/stashapp/stash/releases/tags/latest_develop" | jq -re .target_commitish) || exit 1
3
4
[[ ${version} == " develop" ]] && version=$( curl -u " ${GITHUB_ACTOR} :${GITHUB_TOKEN} " -fsSL " https://api.github.com/repos/stashapp/stash/commits/develop" | jq -re .sha) || exit 1
4
- curl -fsSL " https://github.com/stashapp/stash/releases/download/latest_develop/CHECKSUMS_SHA1" -o CHECKSUMS_SHA1 || exit 1
5
- grep -q " ${version: 0: 7} " < CHECKSUMS_SHA1 || exit 1
6
- curl -fsSL " https://github.com/stashapp/stash/releases/download/latest_develop/stash-linux" -o stash || exit 1
7
- checksum=" $( sha1sum stash | awk ' {print $1}' ) "
8
- grep -q " ${checksum} " < CHECKSUMS_SHA1 || exit 1
9
- rm -rf CHECKSUMS_SHA1 stash
10
- json=$( cat VERSION.json)
11
- jq --sort-keys \
12
- --arg version " ${version// v/ } " \
13
- ' .version = $version' <<< " ${json}" | tee VERSION.json
5
+ if [[ " ${version} " != " ${old_version} " ]]; then
6
+ curl -fsSL " https://github.com/stashapp/stash/releases/download/latest_develop/CHECKSUMS_SHA1" -o CHECKSUMS_SHA1 || exit 1
7
+ grep -q " ${version: 0: 7} " < CHECKSUMS_SHA1 || exit 1
8
+ curl -fsSL " https://github.com/stashapp/stash/releases/download/latest_develop/stash-linux" -o stash || exit 1
9
+ checksum=" $( sha1sum stash | awk ' {print $1}' ) "
10
+ grep -q " ${checksum} " < CHECKSUMS_SHA1 || exit 1
11
+ rm -rf CHECKSUMS_SHA1 stash
12
+ json=$( cat VERSION.json)
13
+ jq --sort-keys \
14
+ --arg version " ${version// v/ } " \
15
+ ' .version = $version' <<< " ${json}" | tee VERSION.json
16
+ fi
You can’t perform that action at this time.
0 commit comments