diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index b49949223..7a0938ef4 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -46,6 +46,8 @@ jobs: BUILDTYPE: Debug IS_LOCAL_DEVELOPMENT: false MLN_ANDROID_STL: c++_static + outputs: + make_release: ${{ steps.make_release.outputs.make_release }} steps: - name: Free Disk Space (Ubuntu) if: startsWith(runner.name, 'GitHub Actions') @@ -200,6 +202,17 @@ jobs: platform/android/InstrumentationTestApp.apk platform/android/InstrumentationTests.apk + - name: VERSION file changed + id: version-file-android-changed + uses: tj-actions/changed-files@v46 + with: + files: platform/android/VERSION + + - name: Should make release? + id: make_release + if: github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.version-file-android-changed.outputs.any_changed == 'true' + run: echo make_release=true >> "$GITHUB_OUTPUT" + android-build-cpp-test: runs-on: ubuntu-24.04 @@ -328,5 +341,9 @@ jobs: - android-build-render-test steps: - name: Mark result as failed - if: needs.android-build.result != 'success' + if: needs.android-build.result != 'success' || needs.android-build-cpp-test.result != 'success' || needs.android-build-render-test.result != 'success' run: exit 1 + + - name: Trigger release + if: needs.android-build.outputs.make_release == 'true' && needs.android-build.result == 'success' && needs.android-build-cpp-test.result == 'success' && needs.android-build-render-test.result == 'success' + run: gh workflow run android-release.yml --ref ${{ github.sha }} diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 8b7784fe0..986384be8 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -42,17 +42,9 @@ jobs: - name: Android nitpick run: make run-android-nitpick - - name: Update version name + - name: Set version name run: | - RELEASE_VERSION="$( git describe --tags --match=android-v*.*.* --abbrev=0 | sed 's/^android-v//' )" - echo version="$RELEASE_VERSION" >> "$GITHUB_ENV" - echo "Latest version from tag: $RELEASE_VERSION" - if [ -n "$RELEASE_VERSION" ]; then - sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${RELEASE_VERSION}/" MapLibreAndroid/gradle.properties - echo "MapLibreAndroid/gradle.properties:" - cat MapLibreAndroid/gradle.properties - fi - shell: bash + echo version="$(cat VERSION)" > "$GITHUB_ENV" - name: Build package run: | @@ -68,7 +60,7 @@ jobs: RELEASE_NOTES_PATH="${PWD}/release_notes.txt" node scripts/release-notes.mjs > "${RELEASE_NOTES_PATH}" echo release_notes="${RELEASE_NOTES_PATH}" >> "$GITHUB_OUTPUT" - echo version_tag="$( git describe --tags --match=android-v*.*.* --abbrev=0 )" >> "$GITHUB_OUTPUT" + echo version_tag=android-v${{ env.version }} >> "$GITHUB_OUTPUT" shell: bash - name: Check if version is pre-release @@ -83,6 +75,11 @@ jobs: echo "prerelease=true" >> "$GITHUB_ENV" fi + - name: Create tag + run: | + git tag -s -a android-v${{ env.version }} -m "Publish android-v${{ env.version }}" ${{ github.sha }} + git push origin android-v${{ env.version }} + - name: Create release id: create_release uses: actions/create-release@v1 diff --git a/docs/mdbook/src/platforms/android/release.md b/docs/mdbook/src/platforms/android/release.md index 3906115fe..39800a1d3 100644 --- a/docs/mdbook/src/platforms/android/release.md +++ b/docs/mdbook/src/platforms/android/release.md @@ -19,20 +19,6 @@ To make an Android release, do the following: ## 9.6.0 ``` - - Update `android/MapLibreAndroid/gradle.properties` with the new version. + - Update `android/VERSION` with the new version. -2. Once the pull request updating the changelog is merged, tag the commit: - - - Create a tag locally, with for example: - ``` - git tag -a android-v9.6.0 -m "Release android-v9.6.0" - ``` - - You need write access to push the tag, use for example: - ``` - git push --atomic origin main android-v9.6.0 - ``` - -3. Once the tag is pushed, you can run the [`android-release.yml`](https://github.com/maplibre/maplibre-native/blob/main/.github/workflows/android-release.yml) workflow. - - - Open the [android-release](https://github.com/maplibre/maplibre-native/actions/workflows/android-release.yml) workflow page. - - Press *Run workflow* and select the tag you pushed. +2. Once the PR is merged, the [`android-release.yml`](https://github.com/maplibre/maplibre-native/blob/main/.github/workflows/android-release.yml) workflow will run automatically to make the release. diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index bd4dcadee..e83bd2f7b 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -1,10 +1,15 @@ # Changelog MapLibre Native for Android +## 11.9.0-pre0 + +Pre-release to test out the new [dynamic texture atlas](https://github.com/maplibre/maplibre-native/pull/3198). This should result in a memory reduction. Please [open an issue](https://github.com/maplibre/maplibre-native/issues) if you encounter any problems. + ## 11.8.8 ### ✨ Features and improvements - Update NDK to 28.1.13356709 ([#3450](https://github.com/maplibre/maplibre-native/pull/3450)). +- Add support to range requests in AssetFileSource ([#3461](https://github.com/maplibre/maplibre-native/pull/3404)). ### 🐞 Bug fixes diff --git a/platform/android/MapLibreAndroid/build.gradle.kts b/platform/android/MapLibreAndroid/build.gradle.kts index b642cf50e..6cd320d4e 100644 --- a/platform/android/MapLibreAndroid/build.gradle.kts +++ b/platform/android/MapLibreAndroid/build.gradle.kts @@ -67,7 +67,7 @@ android { buildConfigField( "String", "MAPLIBRE_VERSION_STRING", - "\"MapLibre Native/${project.property("VERSION_NAME")}\"" + "\"MapLibre Android/${project.extra["versionName"]}\"" ) consumerProguardFiles("proguard-rules.pro") } diff --git a/platform/android/MapLibreAndroid/gradle.properties b/platform/android/MapLibreAndroid/gradle.properties index 6c03dbe46..efa7f7574 100644 --- a/platform/android/MapLibreAndroid/gradle.properties +++ b/platform/android/MapLibreAndroid/gradle.properties @@ -1,5 +1,3 @@ -VERSION_NAME=11.8.8 - # Only build native dependencies for the current ABI # See https://code.google.com/p/android/issues/detail?id=221098#c20 android.buildOnlyTargetAbi=true diff --git a/platform/android/VERSION b/platform/android/VERSION new file mode 100644 index 000000000..330c09652 --- /dev/null +++ b/platform/android/VERSION @@ -0,0 +1 @@ +11.9.0-pre0 diff --git a/platform/android/buildSrc/src/main/kotlin/maplibre.artifact-settings.gradle.kts b/platform/android/buildSrc/src/main/kotlin/maplibre.artifact-settings.gradle.kts index 20ef73459..33ca3b2c5 100644 --- a/platform/android/buildSrc/src/main/kotlin/maplibre.artifact-settings.gradle.kts +++ b/platform/android/buildSrc/src/main/kotlin/maplibre.artifact-settings.gradle.kts @@ -9,9 +9,11 @@ extra["mapLibreArtifactScmUrl"] = "scm:git@github.com:maplibre/maplibre-native.g extra["mapLibreArtifactLicenseName"] = "BSD" extra["mapLibreArtifactLicenseUrl"] = "https://opensource.org/licenses/BSD-2-Clause" -// Handling conditional assignment for versionName -extra["versionName"] = if (project.hasProperty("VERSION_NAME")) { - project.property("VERSION_NAME") +val versionFilePath = rootDir.resolve("VERSION") +val versionName = if (versionFilePath.exists()) { + versionFilePath.readText().trim() } else { - System.getenv("VERSION_NAME") + throw GradleException("VERSION file not found at ${versionFilePath.absolutePath}") } + +extra["versionName"] = versionName