19 lines
823 B
Bash
19 lines
823 B
Bash
|
|
# release-version.sh — the version every published build carries.
|
||
|
|
#
|
||
|
|
# SOURCE this from the repo root. It sets:
|
||
|
|
#
|
||
|
|
# release_count commits on HEAD; only ever goes up on main
|
||
|
|
# release_version <major>.<minor>.<release_count>, e.g. 0.1.47
|
||
|
|
# release_dirty true when tracked files have uncommitted changes
|
||
|
|
#
|
||
|
|
# Major and minor come from tauri.conf.json; the patch is the commit count, so
|
||
|
|
# any commit can ship without a manual bump, and the number is plain enough for
|
||
|
|
# every package format (Android versionCode, RPM, MSI, semver).
|
||
|
|
|
||
|
|
release_count="$(git rev-list --count HEAD)"
|
||
|
|
release_version="$(node -p "require('./src-tauri/tauri.conf.json').version.split('.').slice(0, 2).join('.')").$release_count"
|
||
|
|
release_dirty=false
|
||
|
|
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
||
|
|
release_dirty=true
|
||
|
|
fi
|