Release workflow fixes, release MapLibre Android 11.9.0 (#3491)

This commit is contained in:
Bart Louwers
2025-05-25 22:21:09 +02:00
committed by GitHub
parent 89f453604b
commit 5ec8430fa3
6 changed files with 56 additions and 61 deletions

View File

@@ -344,12 +344,19 @@ jobs:
- android-build-cpp-test
- android-build-render-test
steps:
- name: Set success=true
if: needs.android-build.result == 'success' && needs.android-build-cpp-test.result == 'success' && needs.android-build-render-test.result == 'success'
run: echo success=true > "$GITHUB_ENV"
- name: Mark result as failed
if: needs.android-build.result != 'success' || needs.android-build-cpp-test.result != 'success' || needs.android-build-render-test.result != 'success'
if: env.success != 'true'
run: exit 1
- uses: actions/checkout@v4
if: needs.android-build.outputs.make_release == 'true' && env.success
- 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'
if: needs.android-build.outputs.make_release == 'true' && env.success
run: gh workflow run android-release.yml --ref ${{ github.sha }}
env:
GH_TOKEN: ${{ github.token }}

View File

@@ -51,7 +51,7 @@ jobs:
id: prepare_release
run: |
RELEASE_NOTES_PATH="${PWD}/release_notes.txt"
node scripts/release-notes.mjs > "${RELEASE_NOTES_PATH}"
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

View File

@@ -1,5 +1,24 @@
# Changelog MapLibre Native for Android
## main
### ✨ Features and improvements
### 🐞 Bug fixes
## 11.9.0
### ✨ Features and improvements
- Add dynamic texture atlas ([#3198](https://github.com/maplibre/maplibre-native/pull/3198)).
- Remove some of unused legacy uniforms ([#3481](https://github.com/maplibre/maplibre-native/pull/3481)).
### 🐞 Bug fixes
- Fix vulkan scaling issue ([#3489](https://github.com/maplibre/maplibre-native/pull/3489)).
- Fix swapchain out of bounds ([#3486](https://github.com/maplibre/maplibre-native/pull/3486)).
- Fix validation error reported by VulkanSDK 1.4.313.0 ([#3471](https://github.com/maplibre/maplibre-native/pull/3471)).P
## 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.
@@ -10,6 +29,7 @@ Pre-release to test out the new [dynamic texture atlas](https://github.com/mapli
- 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)).
- Force PMTiles metadata to always have XYZ tile scheme ([#3403](https://github.com/maplibre/maplibre-native/pull/3403)).
### 🐞 Bug fixes

View File

@@ -1 +1 @@
11.9.0-pre0
11.9.0

View File

@@ -1 +0,0 @@
<%-CHANGELOG-%>

View File

@@ -1,73 +1,42 @@
import fs from 'node:fs';
import { execSync } from 'node:child_process';
import ejs from 'ejs';
import _ from 'lodash';
import semver from 'semver';
const changelogPath = 'CHANGELOG.md';
const changelog = fs.readFileSync(changelogPath, 'utf8');
/*
Find current and immediately previous releases by parsing git tags.
*/
let currentVersion = execSync('git describe --tags --match=android-v*.*.* --abbrev=0')
.toString()
.trim()
.replace('android-v', '');
function usage() {
console.error(`Usage ${process.argv[0]} ${process.argv[1]} current-version`);
process.exit(1);
}
let gitTags = execSync('git tag --list android-v*.*.*')
.toString()
.split('\n')
.map(function (tag) {
tag = tag.replace('android-v', '').trim();
return semver.clean(tag);
});
let previousVersion = semver.maxSatisfying(gitTags, "<" + currentVersion);
if (process.argv.length !== 3) {
usage();
}
let currentVersion = process.argv[2];
if (typeof currentVersion !== 'string') {
usage();
}
/*
Parse the raw changelog text and split it into individual releases.
This regular expression:
- Matches lines starting with "## x.x.x".
- Groups the version number.
- Skips the (optional) release date.
- Groups the changelog content.
- Ends when another "## x.x.x" is found.
*/
const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;
const regex = /^## (\d+\.\d+\.\d+(?:-[^\s]+)?).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+(?:-[^\s]+)?.*?\n)/gms;
let releaseNotes = [];
let releaseNotes = {};
let match;
while (match = regex.exec(changelog)) {
releaseNotes.push({
'version': match[1],
'changelog': match[2].trim(),
});
const version = match[1];
const changelog = match[2].trim();
releaseNotes[version] = changelog;
}
/*
Match the current tag with the most appropriate release notes.
*/
const versionsInReleaseNotes = _.map(releaseNotes, 'version');
const bestReleaseNotesForCurrentVersion = semver.minSatisfying(versionsInReleaseNotes, ">=" + currentVersion);
const currentReleaseNotes = _.find(releaseNotes, { version: bestReleaseNotesForCurrentVersion });
if (!currentReleaseNotes) {
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "main" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
process.exit(1);
if (releaseNotes[currentVersion]) {
process.stdout.write(releaseNotes[currentVersion]);
} else if (currentVersion.includes("pre")) {
console.error(`No release notes found for version ${currentVersion}, ignoring since pre release.`);
process.exit(0);
} else {
console.error(`No release notes found for version ${currentVersion}, please update the changelog.`);
process.exit(1);
}
/*
Fill and print the release notes template.
*/
let templatedReleaseNotes;
templatedReleaseNotes = ejs.render(fs.readFileSync('scripts/release-notes-github.md.ejs', 'utf8'), {
'CURRENTVERSION': currentVersion,
'PREVIOUSVERSION': previousVersion,
'CHANGELOG': currentReleaseNotes.changelog,
'isPrerelease': semver.prerelease(currentVersion)
});
templatedReleaseNotes = templatedReleaseNotes.trimEnd();
process.stdout.write(templatedReleaseNotes);