Skip to content

Commit 9266ac8

Browse files
committed
⬆️ chore: bump JDK to 21 and stabilize the release pipeline
Post-PR #4 follow-up that consolidates several CI / build fixes into one squashed commit: - **JDK 17 → 21** across all module build files, both CI workflows, and the Docker base image. Matches F-Droid's buildserver and removes the Kotlin/Java JVM-target mismatch we hit on first submission. - **Main-branch CalVer tagging in CI** — the build job now computes a fresh \`vYYYY.MM.DD.<run>\` tag locally before Gradle runs so its git-describe finds an exact match. Previously the release action tagged with the literal git-describe output (\`v2026.05.08.30-1-g1be0321\`). - **Release job version pass-through** — release runner gets a fresh checkout with no local tag, so feed the build job's computed version in via \`QUIRE_VERSION_FALLBACK\`. - **CodeQL fallback** — same fallback for the analyze workflow, plus \`fetch-tags: true\` on its checkout. - **Disable AGP 8.3+ VCS-info embedding** in the release buildType so F-Droid's reproducible-build verification has a chance.
1 parent aace637 commit 9266ac8

11 files changed

Lines changed: 60 additions & 33 deletions

File tree

.github/workflows/android-ci.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,31 @@ jobs:
4747
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
4848
with:
4949
distribution: temurin
50-
java-version: "17"
50+
java-version: "21"
5151
- uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
5252
with:
5353
packages: "platform-tools platforms;android-34 build-tools;34.0.0"
5454
- uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
5555
- id: version
5656
name: Compute version
5757
run: |
58-
# Match what app/build.gradle.kts derives from the same checkout.
59-
# Tags are pulled by checkout's fetch-tags: true; verify here.
60-
if ! git describe --tags --match 'v*' --abbrev=0 >/dev/null 2>&1; then
61-
echo "::error::No matching v* tag in history. Build will fail."
62-
git tag -l 'v*' | head
63-
exit 1
58+
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
59+
# On main: bump CalVer (date + CI run number) and tag the HEAD
60+
# locally so Gradle's git-describe finds an exact-match tag.
61+
# The release job pushes this tag when it creates the Release.
62+
BUILD_DATE=$(date -u +%Y-%m-%d)
63+
VERSION="${BUILD_DATE//-/.}.${GITHUB_RUN_NUMBER}"
64+
git tag "v$VERSION"
65+
else
66+
# On PRs / feature branches: derive from existing tag history.
67+
# Post-tag dev format is fine for non-release artifact names.
68+
if ! git describe --tags --match 'v*' --abbrev=0 >/dev/null 2>&1; then
69+
echo "::error::No matching v* tag in history. Build will fail."
70+
git tag -l 'v*' | head
71+
exit 1
72+
fi
73+
VERSION=$(git describe --tags --match 'v*' --always | sed 's/^v//')
6474
fi
65-
VERSION=$(git describe --tags --match 'v*' --always | sed 's/^v//')
6675
echo "VERSION_NAME=$VERSION" >> "$GITHUB_ENV"
6776
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
6877
echo "Building version $VERSION"
@@ -98,7 +107,7 @@ jobs:
98107
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
99108
with:
100109
distribution: temurin
101-
java-version: "17"
110+
java-version: "21"
102111
- uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
103112
with:
104113
packages: "platform-tools platforms;android-34 build-tools;34.0.0"
@@ -110,6 +119,11 @@ jobs:
110119
KEYSTORE_B64: ${{ secrets.QUIRE_RELEASE_KEYSTORE_B64 }}
111120
- name: Assemble release APK
112121
env:
122+
# The build job created the tag locally on its runner so Gradle's
123+
# git-describe found an exact match. Each release-job runner gets
124+
# a fresh checkout with no local tag, so feed the same CalVer in
125+
# via the parser's fallback path.
126+
QUIRE_VERSION_FALLBACK: ${{ needs.build.outputs.version }}
113127
QUIRE_RELEASE_KEYSTORE: ${{ secrets.QUIRE_RELEASE_KEYSTORE_B64 != '' && format('{0}/release.keystore', runner.temp) || '' }}
114128
QUIRE_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.QUIRE_RELEASE_KEYSTORE_PASSWORD }}
115129
QUIRE_RELEASE_KEY_ALIAS: ${{ secrets.QUIRE_RELEASE_KEY_ALIAS }}

.github/workflows/codeql.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
language: [java-kotlin, python]
3131
steps:
3232
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
33+
with:
34+
fetch-depth: 0
35+
fetch-tags: true
3336
- name: Initialize CodeQL
3437
uses: github/codeql-action/init@0daab03d71ff584ef619d027a3fd9146679c5d84 # v3
3538
with:
@@ -38,12 +41,17 @@ jobs:
3841
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
3942
with:
4043
distribution: temurin
41-
java-version: "17"
44+
java-version: "21"
4245
- if: matrix.language == 'java-kotlin'
4346
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
4447
with:
4548
packages: "platform-tools platforms;android-34 build-tools;34.0.0"
4649
- if: matrix.language == 'java-kotlin'
50+
env:
51+
# CodeQL doesn't need a meaningful version — fall back to a fixed
52+
# placeholder so the version derivation in app/build.gradle.kts
53+
# succeeds even when no v* tag is reachable from this commit.
54+
QUIRE_VERSION_FALLBACK: 2026.05.08.0
4755
run: ./gradlew assembleDebug -x test --stacktrace
4856
- if: matrix.language == 'python'
4957
uses: github/codeql-action/autobuild@0daab03d71ff584ef619d027a3fd9146679c5d84 # v3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 eclipse-temurin:17-jdk-jammy
1+
FROM --platform=linux/amd64 eclipse-temurin:21-jdk-jammy
22

33
ARG ANDROID_CMDLINE_TOOLS_VERSION=11076708
44
ARG ANDROID_PLATFORM=android-34

app/build.gradle.kts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ android {
3737
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3838
}
3939
compileOptions {
40-
sourceCompatibility = JavaVersion.VERSION_17
41-
targetCompatibility = JavaVersion.VERSION_17
40+
sourceCompatibility = JavaVersion.VERSION_21
41+
targetCompatibility = JavaVersion.VERSION_21
4242
isCoreLibraryDesugaringEnabled = true
4343
}
44-
kotlinOptions { jvmTarget = "17" }
44+
kotlinOptions { jvmTarget = "21" }
4545
buildFeatures { compose = true }
4646
testOptions { unitTests.isIncludeAndroidResources = true }
4747
signingConfigs {
@@ -59,6 +59,11 @@ android {
5959
debug { isMinifyEnabled = false }
6060
release {
6161
isMinifyEnabled = false // Phase 1 only; revisit before publishing
62+
// AGP 8.3+ embeds git origin/branch/SHA into the APK by default,
63+
// which makes F-Droid reproducible builds fail (their checkout's
64+
// origin URL differs from ours). The tag itself already pins the
65+
// commit, so we don't lose useful info by disabling this.
66+
vcsInfo.include = false
6267
signingConfig =
6368
if (System.getenv("QUIRE_RELEASE_KEYSTORE").isNullOrBlank())
6469
signingConfigs.getByName("debug")

auth/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ android {
1010
minSdk = 26
1111
}
1212
compileOptions {
13-
sourceCompatibility = JavaVersion.VERSION_17
14-
targetCompatibility = JavaVersion.VERSION_17
13+
sourceCompatibility = JavaVersion.VERSION_21
14+
targetCompatibility = JavaVersion.VERSION_21
1515
}
16-
kotlinOptions { jvmTarget = "17" }
16+
kotlinOptions { jvmTarget = "21" }
1717
testOptions { unitTests.isIncludeAndroidResources = true }
1818
}
1919

core/identity/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ plugins {
44
}
55

66
java {
7-
sourceCompatibility = JavaVersion.VERSION_17
8-
targetCompatibility = JavaVersion.VERSION_17
7+
sourceCompatibility = JavaVersion.VERSION_21
8+
targetCompatibility = JavaVersion.VERSION_21
99
}
1010

1111
dependencies {

core/model/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ plugins {
33
}
44

55
java {
6-
sourceCompatibility = JavaVersion.VERSION_17
7-
targetCompatibility = JavaVersion.VERSION_17
6+
sourceCompatibility = JavaVersion.VERSION_21
7+
targetCompatibility = JavaVersion.VERSION_21
88
}
99

1010
dependencies {

data/local/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ android {
1313
ksp { arg("room.schemaLocation", "$projectDir/schemas") }
1414
}
1515
compileOptions {
16-
sourceCompatibility = JavaVersion.VERSION_17
17-
targetCompatibility = JavaVersion.VERSION_17
16+
sourceCompatibility = JavaVersion.VERSION_21
17+
targetCompatibility = JavaVersion.VERSION_21
1818
}
19-
kotlinOptions { jvmTarget = "17" }
19+
kotlinOptions { jvmTarget = "21" }
2020
testOptions { unitTests.isIncludeAndroidResources = true }
2121
sourceSets {
2222
getByName("test") {

data/opds/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ android {
1212
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
compileOptions {
15-
sourceCompatibility = JavaVersion.VERSION_17
16-
targetCompatibility = JavaVersion.VERSION_17
15+
sourceCompatibility = JavaVersion.VERSION_21
16+
targetCompatibility = JavaVersion.VERSION_21
1717
isCoreLibraryDesugaringEnabled = true
1818
}
19-
kotlinOptions { jvmTarget = "17" }
19+
kotlinOptions { jvmTarget = "21" }
2020
testOptions { unitTests.isIncludeAndroidResources = true }
2121
}
2222

data/sync/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ android {
1212
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
compileOptions {
15-
sourceCompatibility = JavaVersion.VERSION_17
16-
targetCompatibility = JavaVersion.VERSION_17
15+
sourceCompatibility = JavaVersion.VERSION_21
16+
targetCompatibility = JavaVersion.VERSION_21
1717
}
18-
kotlinOptions { jvmTarget = "17" }
18+
kotlinOptions { jvmTarget = "21" }
1919
testOptions { unitTests.isIncludeAndroidResources = true }
2020
}
2121

0 commit comments

Comments
 (0)