diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 8bd82d6..f400078 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -73,12 +73,21 @@ jobs: CURRENT=$(grep '^version:' pubspec.yaml | awk '{print $2}') SEMVER=$(echo "$CURRENT" | cut -d'+' -f1) BUILD=$(echo "$CURRENT" | cut -d'+' -f2) - MAJOR=$(echo "$SEMVER" | cut -d. -f1) - MINOR=$(echo "$SEMVER" | cut -d. -f2) - PATCH=$(echo "$SEMVER" | cut -d. -f3) - NEW_PATCH=$((PATCH + 1)) NEW_BUILD=$((BUILD + 1)) - NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}+${NEW_BUILD}" + # If the triggering commit explicitly pins the version name via the + # [version set] marker, ship that semver as-is (a milestone like 1.0.0 + # or a major/minor jump the automatic patch bump cannot reach) and only + # advance the build number, which Google Play requires to stay + # monotonic. Otherwise keep the default automatic patch+build bump. + if git log -1 --pretty=%B | grep -q '\[version set\]'; then + NEW_VERSION="${SEMVER}+${NEW_BUILD}" + else + MAJOR=$(echo "$SEMVER" | cut -d. -f1) + MINOR=$(echo "$SEMVER" | cut -d. -f2) + PATCH=$(echo "$SEMVER" | cut -d. -f3) + NEW_PATCH=$((PATCH + 1)) + NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}+${NEW_BUILD}" + fi sed -i '' "s/^version: .*/version: ${NEW_VERSION}/" pubspec.yaml git add pubspec.yaml git commit -m "chore: bump version to ${NEW_VERSION} [ci skip]" diff --git a/pubspec.yaml b/pubspec.yaml index 295aad1..c39fdb8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: pluriwave description: "Radio mundial con ecualizador, reconocimiento de canciones y UI premium" publish_to: 'none' -version: 0.1.102+103 +version: 1.0.0+103 environment: sdk: ^3.7.0