Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
178 lines
6.5 KiB
YAML
178 lines
6.5 KiB
YAML
name: android-release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
android-create-release:
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
version_tag: ${{ steps.prepare_release.outputs.version_tag }}
|
|
defaults:
|
|
run:
|
|
working-directory: platform/android
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
|
|
|
- name: Validate and set version
|
|
working-directory: .
|
|
run: .github/scripts/validate-version.sh platform/android/VERSION
|
|
|
|
- name: npm install
|
|
run: npm install --ignore-scripts
|
|
|
|
# create github release
|
|
- name: Prepare release
|
|
id: prepare_release
|
|
run: |
|
|
RELEASE_NOTES_PATH="${PWD}/release_notes.txt"
|
|
node scripts/release-notes.mjs ${{ env.version }} > "${RELEASE_NOTES_PATH}"
|
|
echo release_notes="${RELEASE_NOTES_PATH}" >> "$GITHUB_OUTPUT"
|
|
echo version_tag=android-v${{ env.version }} >> "$GITHUB_OUTPUT"
|
|
shell: bash
|
|
|
|
- name: Check if version is pre-release
|
|
id: check_version
|
|
run: |
|
|
version="${{ env.version }}"
|
|
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Valid semver: $version"
|
|
echo "prerelease=false" >> "$GITHUB_ENV"
|
|
else
|
|
echo "Invalid semver: $version"
|
|
echo "prerelease=true" >> "$GITHUB_ENV"
|
|
fi
|
|
|
|
- name: Create tag if it does not exist
|
|
working-directory: .
|
|
run: .github/scripts/ensure-tag.sh android-v${{ env.version }} ${{ github.sha }}
|
|
|
|
- name: Create release (draft)
|
|
id: create_release
|
|
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
with:
|
|
tag_name: ${{ steps.prepare_release.outputs.version_tag }}
|
|
name: ${{ steps.prepare_release.outputs.version_tag }}
|
|
body_path: ${{ steps.prepare_release.outputs.release_notes }}
|
|
draft: true
|
|
prerelease: ${{ env.prerelease }}
|
|
|
|
android-build-and-upload-release:
|
|
needs: android-create-release
|
|
runs-on: MapLibre_Native_Ubuntu_24_04_x84_16_core
|
|
defaults:
|
|
run:
|
|
working-directory: platform/android
|
|
env:
|
|
JOBS: 8
|
|
IS_LOCAL_DEVELOPMENT: false
|
|
strategy:
|
|
matrix:
|
|
RENDERER:
|
|
- vulkan
|
|
- opengl
|
|
BUILDTYPE:
|
|
- Release
|
|
- Debug
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
|
|
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v4
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
|
|
- name: npm install
|
|
run: npm install --ignore-scripts
|
|
|
|
- name: Android nitpick
|
|
run: make run-android-nitpick
|
|
|
|
- name: Build package
|
|
run: RENDERER=${{ matrix.RENDERER }} BUILDTYPE=${{ matrix.BUILDTYPE }} make apackage
|
|
|
|
- name: Save buildtype to GITHUB_ENV
|
|
run: |
|
|
buildtype=${{ matrix.BUILDTYPE }}
|
|
# lowercase
|
|
echo buildtype=${buildtype,,} > "$GITHUB_ENV"
|
|
|
|
- name: Prepare release asset filenames (include tag)
|
|
run: |
|
|
version_tag='${{ needs.android-create-release.outputs.version_tag }}'
|
|
# AAR
|
|
aar_dir='MapLibreAndroid/build/outputs/aar'
|
|
mv "$aar_dir/MapLibreAndroid-${{ matrix.RENDERER }}-${{ env.buildtype }}.aar" \
|
|
"$aar_dir/MapLibreAndroid-${{ matrix.RENDERER }}-${{ env.buildtype }}-$version_tag.aar"
|
|
# Debug symbols
|
|
mv "build/debug-symbols-${{ matrix.RENDERER }}-${{ env.buildtype }}.tar.gz" \
|
|
"build/debug-symbols-maplibre-android-${{ matrix.RENDERER }}-${{ env.buildtype }}-$version_tag.tar.gz"
|
|
|
|
- name: Upload release assets (${{ matrix.RENDERER }}, ${{ matrix.BUILDTYPE }})
|
|
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
with:
|
|
tag_name: ${{ needs.android-create-release.outputs.version_tag }}
|
|
fail_on_unmatched_files: true
|
|
draft: true
|
|
files: |
|
|
platform/android/MapLibreAndroid/build/outputs/aar/MapLibreAndroid-${{ matrix.RENDERER }}-${{ env.buildtype }}-${{ needs.android-create-release.outputs.version_tag }}.aar
|
|
platform/android/build/debug-symbols-maplibre-android-${{ matrix.RENDERER }}-${{ env.buildtype }}-${{ needs.android-create-release.outputs.version_tag }}.tar.gz
|
|
|
|
- name: Publish to MavenCentral
|
|
run: |
|
|
renderer=${{ matrix.RENDERER }}
|
|
if [ "$renderer" = "opengl" ]; then
|
|
./gradlew :MapLibreAndroid:publishOpengl${{ env.buildtype }}PublicationToMavenCentralRepository
|
|
./gradlew :MapLibreAndroid:publishDefault${{ env.buildtype }}PublicationToMavenCentralRepository
|
|
else
|
|
./gradlew :MapLibreAndroid:publishVulkan${{ env.buildtype }}PublicationToMavenCentralRepository
|
|
fi
|
|
env:
|
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
|
|
|
|
finilize-release:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- android-create-release
|
|
- android-build-and-upload-release
|
|
steps:
|
|
- name: Publish release (remove draft)
|
|
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
with:
|
|
tag_name: ${{ needs.android-create-release.outputs.version_tag }}
|
|
name: ${{ needs.android-create-release.outputs.version_tag }}
|
|
draft: false
|
|
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
|
|
|
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v4
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
|
|
- run: npm install
|
|
working-directory: .
|
|
|
|
- name: Write release notifications
|
|
if: github.repository_owner == 'maplibre'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: node .github/scripts/notify-release-on-prs.ts --tag ${{ needs.android-create-release.outputs.version_tag }}
|
|
working-directory: .
|