Use ESM in release-notes Android script (#2773)

This commit is contained in:
Bart Louwers
2024-08-27 23:03:33 +02:00
committed by GitHub
parent 84bcf8cb5b
commit 2280bf8018
2 changed files with 7 additions and 8 deletions

View File

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

View File

@@ -1,10 +1,8 @@
#!/usr/bin/env node
const fs = require('fs');
const execSync = require('child_process').execSync;
const ejs = require('ejs');
const _ = require('lodash');
const semver = require('semver');
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');
@@ -39,6 +37,7 @@ let previousVersion = semver.maxSatisfying(gitTags, "<" + currentVersion);
const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;
let releaseNotes = [];
let match;
while (match = regex.exec(changelog)) {
releaseNotes.push({
'version': match[1],