Use ESM in release-notes Android script (#2773)
This commit is contained in:
2
.github/workflows/android-release.yml
vendored
2
.github/workflows/android-release.yml
vendored
@@ -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
|
||||
|
||||
@@ -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],
|
||||
Reference in New Issue
Block a user