Skip to content

Commit 4890144

Browse files
Merge branch 'stage' into ADFA-5442-Change-window-name-to-Addons-Manager
2 parents 3c4000f + a2290ea commit 4890144

4 files changed

Lines changed: 49 additions & 24 deletions

File tree

‎.github/workflows/debug.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,15 @@ jobs:
466466
467467
echo "Found Jira ticket: $JIRA_TICKET"
468468
469-
# Validate NEXT_RELEASE_VERSION exists and exactly two digits, dot, two digits
469+
# Validate NEXT_RELEASE_VERSION format
470470
if [ -z "$NEXT_RELEASE_VERSION" ]; then
471471
echo "ERROR: NEXT_RELEASE_VERSION variable is not set"
472472
exit 1
473473
fi
474474
475-
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}$ ]]; then
475+
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then
476476
echo "ERROR: NEXT_RELEASE_VERSION format is invalid: $NEXT_RELEASE_VERSION"
477-
echo "Expected format: YY.ww (two digits, dot, two digits, e.g., 25.50)"
477+
echo "Expected format: YY.ww[.patch] (e.g., 25.50 or 25.50.1)"
478478
exit 1
479479
fi
480480

‎.github/workflows/release.yml‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
schedule:
1010
- cron: '0 12 * * *' # Daily at 12:00 PM UTC
1111
workflow_dispatch:
12+
inputs:
13+
hotfix_version:
14+
description: 'Version stamp for an off-cycle release (e.g. 26.38.1). Still merges stage into main and builds main.'
15+
required: false
16+
type: string
1217

1318
env:
1419
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -485,15 +490,15 @@ jobs:
485490
486491
- name: Validate release version
487492
env:
488-
NEXT_RELEASE_VERSION: ${{ vars.NEXT_RELEASE_VERSION }}
493+
NEXT_RELEASE_VERSION: ${{ github.event.inputs.hotfix_version || vars.NEXT_RELEASE_VERSION }}
489494
run: |
490495
if [ -z "$NEXT_RELEASE_VERSION" ]; then
491496
echo "ERROR: NEXT_RELEASE_VERSION variable is not set"
492497
exit 1
493498
fi
494-
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}$ ]]; then
499+
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then
495500
echo "ERROR: NEXT_RELEASE_VERSION format is invalid: $NEXT_RELEASE_VERSION"
496-
echo "Expected format: YY.ww (two digits, dot, two digits, e.g., 25.50)"
501+
echo "Expected format: YY.ww[.patch] (e.g., 25.50 or 25.50.1)"
497502
exit 1
498503
fi
499504
echo "Validated NEXT_RELEASE_VERSION: $NEXT_RELEASE_VERSION"
@@ -505,7 +510,7 @@ jobs:
505510
- name: Assemble Release APK
506511
env:
507512
INCLUDE_LLAMA_ASSETS: "true"
508-
NEXT_RELEASE_VERSION: ${{ vars.NEXT_RELEASE_VERSION }}
513+
NEXT_RELEASE_VERSION: ${{ github.event.inputs.hotfix_version || vars.NEXT_RELEASE_VERSION }}
509514
run: |
510515
variant_upper=$(echo "${{ matrix.variant }}" | tr '[:lower:]' '[:upper:]')
511516
flox activate -d flox/base -- ./gradlew :app:assemble${variant_upper}Release --no-daemon \

‎.github/workflows/weekly-release.yml‎

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Weekly release (manual)
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
hotfix_version:
7+
description: 'Version for an off-cycle release (e.g. 26.38.1). Publishes the current build under this version instead of the CalVer week.'
8+
required: false
9+
type: string
510

611
permissions:
712
contents: read
@@ -27,12 +32,26 @@ jobs:
2732

2833
- name: Compute CalVer version
2934
id: compute
35+
env:
36+
HOTFIX_VERSION: ${{ github.event.inputs.hotfix_version }}
3037
run: |
31-
VERSION=$(date -u +%g.%V)
38+
if [[ -n "$HOTFIX_VERSION" ]]; then
39+
if [[ ! "$HOTFIX_VERSION" =~ ^[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then
40+
echo "::error::Invalid hotfix version format: $HOTFIX_VERSION"
41+
exit 1
42+
fi
43+
VERSION="$HOTFIX_VERSION"
44+
else
45+
VERSION=$(date -u +%g.%V)
46+
fi
3247
NEXT_VERSION=$(date -u -d "+7 days" +%g.%V)
3348
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3449
echo "next_version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
35-
echo "Releasing $VERSION (next will be $NEXT_VERSION)"
50+
if [[ -n "$HOTFIX_VERSION" ]]; then
51+
echo "Releasing hotfix $VERSION (NEXT_RELEASE_VERSION left unchanged)"
52+
else
53+
echo "Releasing $VERSION (next will be $NEXT_VERSION)"
54+
fi
3655
3756
- name: Look up previous CalVer tag
3857
id: previous
@@ -41,7 +60,7 @@ jobs:
4160
shell: flox activate -d flox/base -- bash -eo pipefail {0}
4261
run: |
4362
PREVIOUS_TAG=$(gh release list --json tagName \
44-
--jq '[.[] | select(.tagName | test("^[0-9]+\\.[0-9]+$"))] | .[0].tagName // ""')
63+
--jq '[.[] | select(.tagName | test("^[0-9]+\\.[0-9]+(\\.[0-9]+)?$"))] | .[0].tagName // ""')
4564
echo "previous_tag=$PREVIOUS_TAG" >> "$GITHUB_OUTPUT"
4665
echo "Previous CalVer tag: ${PREVIOUS_TAG:-none}"
4766
@@ -198,20 +217,20 @@ jobs:
198217
exit 0
199218
fi
200219
220+
# A hotfix cut against a superseded release must not steal the "Latest"
221+
# badge from the newer release that is already published.
222+
IS_LATEST=true
223+
if [[ -n "$PREVIOUS_TAG" ]] \
224+
&& [[ "$(printf '%s\n%s\n' "$VERSION" "$PREVIOUS_TAG" | sort -V | tail -n1)" != "$VERSION" ]]; then
225+
IS_LATEST=false
226+
fi
227+
echo "Marking $VERSION as latest: $IS_LATEST (previous tag: ${PREVIOUS_TAG:-none})"
228+
229+
ARGS=(--target "$GITHUB_SHA" --latest="$IS_LATEST" --title "$VERSION" --generate-notes)
201230
if [[ -n "$PREVIOUS_TAG" && "$PREVIOUS_TAG" != "$VERSION" ]]; then
202-
gh release create "$VERSION" \
203-
--target "$GITHUB_SHA" \
204-
--latest \
205-
--title "$VERSION" \
206-
--generate-notes \
207-
--notes-start-tag "$PREVIOUS_TAG"
208-
else
209-
gh release create "$VERSION" \
210-
--target "$GITHUB_SHA" \
211-
--latest \
212-
--title "$VERSION" \
213-
--generate-notes
231+
ARGS+=(--notes-start-tag "$PREVIOUS_TAG")
214232
fi
233+
gh release create "$VERSION" "${ARGS[@]}"
215234
216235
upload-r2:
217236
needs: [prepare, pull-apk]
@@ -294,6 +313,7 @@ jobs:
294313
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
295314

296315
- name: Set NEXT_RELEASE_VERSION repo variable
316+
if: ${{ github.event.inputs.hotfix_version == '' }}
297317
env:
298318
GH_TOKEN: ${{ steps.app-token.outputs.token }}
299319
NEXT_VERSION: ${{ needs.prepare.outputs.next_version }}

‎composite-builds/build-logic/common/src/main/java/com/itsaky/androidide/build/config/ProjectConfig.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ val Project.releaseVersion: String
108108
.orNull
109109
.orEmpty()
110110
.trim()
111-
if (raw.isNotEmpty() && !Regex("""^\d{2}\.\d{2}$""").matches(raw)) {
111+
if (raw.isNotEmpty() && !Regex("""^\d{2}\.\d{2}(\.\d+)?$""").matches(raw)) {
112112
throw GradleException(
113-
"Invalid next_release_version '$raw'; expected YY.ww (two digits, dot, two digits), e.g. 25.47",
113+
"Invalid next_release_version '$raw'; expected YY.ww with an optional patch, e.g. 25.47 or 25.47.1",
114114
)
115115
}
116116
return raw

0 commit comments

Comments
 (0)