Skip to content

Commit

Permalink
fix version number
Browse files Browse the repository at this point in the history
  • Loading branch information
onemen committed Mar 7, 2024
1 parent 1af18b4 commit 079f627
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@ jobs:

- name: Set version in install.rdf
run: |
version=$(git tag --sort=-creatordate | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n 1 | cut -c 2-)
function next_version() {
local version=$(git tag --sort=-creatordate | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n 1 | cut -c 2-)
if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+-pre\.)([0-9]+)$ ]]; then
local prefix=${BASH_REMATCH[1]}
local number=${BASH_REMATCH[2]}
let "number++"
echo "${prefix}${number}"
else
local IFS='.'
local -a parts=($version)
let "parts[-1]++"
echo "${parts[*]}"
fi
}
version=$(next_version)
date=$(date +'%Y%m%d.%H%M')
sed -i "s/1.0.0-unbundeled/$version-$date/" addon/install.rdf
Expand Down

0 comments on commit 079f627

Please sign in to comment.