Skip to content

Commit 876fd6e

Browse files
fix(release): nightly version = prerelease of next patch (#23)
fix(release): nightly version = prerelease of next patch (0.0.36-beta.N)
2 parents 2bd533e + 55bcc09 commit 876fd6e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ jobs:
6262
git push
6363
else
6464
CHANNEL=beta
65-
# Base version with any existing prerelease suffix stripped, plus a
66-
# monotonic -beta.<run_number>. electron-builder turns the -beta suffix
67-
# into the `beta` channel (beta-mac.yml) automatically. No commit.
65+
# A nightly is a prerelease of the NEXT patch, so it sorts ABOVE the last
66+
# stable, not below it: 0.0.35 stable -> 0.0.36-beta.<run> (NOT
67+
# 0.0.35-beta.<run>, which semver ranks BELOW 0.0.35 and would read as a
68+
# downgrade). electron-builder turns the -beta suffix into the `beta`
69+
# channel (beta-mac.yml) automatically. No commit.
6870
BASE=$(node -p "require('./package.json').version")
6971
BASE=${BASE%%-*}
70-
VERSION="${BASE}-beta.${{ github.run_number }}"
72+
NEXT=$(node -e "const p='$BASE'.split('.').map(Number); console.log(p[0]+'.'+p[1]+'.'+(p[2]+1))")
73+
VERSION="${NEXT}-beta.${{ github.run_number }}"
7174
fi
7275
echo "channel=$CHANNEL" >> "$GITHUB_OUTPUT"
7376
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)