Automate Android releases further (#3472)

This commit is contained in:
Bart Louwers
2025-05-15 17:28:53 +02:00
committed by GitHub
parent 9f034a36ab
commit a810c4de0a
8 changed files with 41 additions and 35 deletions

View File

@@ -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 }}

View File

@@ -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