Automate Android releases further (#3472)
This commit is contained in:
19
.github/workflows/android-ci.yml
vendored
19
.github/workflows/android-ci.yml
vendored
@@ -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 }}
|
||||
|
||||
19
.github/workflows/android-release.yml
vendored
19
.github/workflows/android-release.yml
vendored
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
1
platform/android/VERSION
Normal file
1
platform/android/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
11.9.0-pre0
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user