version fix v3 - final

This commit is contained in:
yazninja 2022-07-28 14:40:21 +08:00
parent 90dc7314d2
commit 4eaf3e0f0f

View file

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
LATEST_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4) LATEST_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4)
COMMITSINCESTABLE=$(git rev-list $LATEST_SHA..HEAD --count) SHA_DATE=$(git show -s --format=%ci $LATEST_SHA)
COMMITSINCESTABLE=$(git rev-list $LATEST_SHA..HEAD --count --since="$SHA_DATE")
CURRENT_VERSION=$(node -p -e "require('./package.json').version") CURRENT_VERSION=$(node -p -e "require('./package.json').version")
if [[ $CIRCLE_BRANCH == "main" && $COMMITSINCESTABLE -gt 0 ]]; then if [[ $CIRCLE_BRANCH == "main" && $COMMITSINCESTABLE -gt 0 ]]; then
NEW_VERSION="${CURRENT_VERSION}-beta.${COMMITSINCESTABLE}" NEW_VERSION="${CURRENT_VERSION}-beta.${COMMITSINCESTABLE}"