diff --git a/.mokogitea/workflows/auto-bump.yml b/.mokogitea/workflows/auto-bump.yml index dc760390..fb990333 100644 --- a/.mokogitea/workflows/auto-bump.yml +++ b/.mokogitea/workflows/auto-bump.yml @@ -16,6 +16,10 @@ on: push: branches: - dev + - alpha + - beta + - rc + - 'feature/**' env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true @@ -57,17 +61,31 @@ jobs: - name: Bump version run: | + BRANCH="${GITHUB_REF_NAME}" + + # Map branch name to stability suffix + # Feature branches (feature/*) use dev stability + case "$BRANCH" in + dev) STABILITY="dev" ;; + alpha) STABILITY="alpha" ;; + beta) STABILITY="beta" ;; + rc) STABILITY="rc" ;; + feature/*) STABILITY="dev" ;; + *) STABILITY="dev" ;; + esac + BUMP=$(php ${MOKO_CLI}/version_bump.php --path . 2>&1) || true echo "$BUMP" VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null) || true [ -z "$VERSION" ] && { echo "No version found — skipping"; exit 0; } - # Propagate to platform manifests with -dev suffix + # version_set_platform strips existing suffixes internally + # Propagate to platform manifests with stability suffix php ${MOKO_CLI}/version_set_platform.php \ - --path . --version "$VERSION" --branch dev --stability dev 2>/dev/null || true + --path . --version "$VERSION" --branch "$BRANCH" --stability "$STABILITY" 2>/dev/null || true php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true - VERSION="${VERSION}-dev" + VERSION="${VERSION}-${STABILITY}" # Commit if anything changed if git diff --quiet && git diff --cached --quiet; then @@ -81,5 +99,5 @@ jobs: git add -A git commit -m "chore(version): auto-bump patch ${VERSION} [skip ci]" \ --author="gitea-actions[bot] " - git push origin dev + git push origin "$BRANCH" echo "Bumped to ${VERSION}" >> $GITHUB_STEP_SUMMARY diff --git a/.mokogitea/workflows/auto-release.yml b/.mokogitea/workflows/auto-release.yml index 72ce95a6..871ecde2 100644 --- a/.mokogitea/workflows/auto-release.yml +++ b/.mokogitea/workflows/auto-release.yml @@ -165,9 +165,8 @@ jobs: echo "skip=true" >> "$GITHUB_OUTPUT" exit 0 fi - # Strip any pre-release suffix merged from dev (e.g. 01.02.20-dev → 01.02.20) - VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//') - MAJOR=$(echo "$VERSION" | cut -d. -f1) + # version_set_platform strips suffixes internally when --stability stable + MAJOR=$(echo "$VERSION" | cut -d. -f1 | sed 's/-.*//') echo "version=${VERSION}" >> "$GITHUB_OUTPUT" echo "release_tag=stable" >> "$GITHUB_OUTPUT" echo "skip=false" >> "$GITHUB_OUTPUT" @@ -201,8 +200,7 @@ jobs: MOKO_API="/tmp/moko-platform-api/cli" php ${MOKO_API}/version_bump.php --path . --minor 2>&1 || true VERSION=$(php ${MOKO_API}/version_read.php --path .) - # Strip any pre-release suffix — stable releases have no suffix - VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//') + # version_set_platform handles suffix stripping — just pass clean base version echo "version=${VERSION}" >> "$GITHUB_OUTPUT" echo "Bumped to: ${VERSION}"