|
@@ -1,3 +1,4 @@
|
|
|
+const childProcess = require('child_process');
|
|
|
const core = require('@actions/core');
|
|
|
const { getVersion, isBeta } = require('./version-helper');
|
|
|
|
|
@@ -22,9 +23,11 @@ const envs = {
|
|
|
envs.ASSET_ZIP = `${envs.RELEASE_PREFIX}-webext-v${envs.VERSION}.zip`;
|
|
|
envs.ASSET_SELF_HOSTED_ZIP = `${envs.RELEASE_PREFIX}-webext-ffself-v${envs.VERSION}.zip`;
|
|
|
|
|
|
-// TODO generate release notes by conventional commit messages and add installation instructions
|
|
|
envs.RELEASE_NOTE = beta ? `\
|
|
|
-**This is a beta release of Violentmonkey, use it at your own risk.**
|
|
|
+**This is a beta release of Violentmonkey, use it at your own risk.**<br>\
|
|
|
+If you already use Violentmonkey, click \`Export to zip\` in settings before installing the beta.
|
|
|
+
|
|
|
+${listCommits()}
|
|
|
` : `\
|
|
|
See <https://violentmonkey.github.io/> for more details.
|
|
|
`;
|
|
@@ -32,3 +35,15 @@ See <https://violentmonkey.github.io/> for more details.
|
|
|
Object.entries(envs).forEach(([key, value]) => {
|
|
|
core.exportVariable(key, value);
|
|
|
});
|
|
|
+
|
|
|
+function listCommits() {
|
|
|
+ const exec = cmd => childProcess.execSync(cmd, {encoding: 'utf8'}).trim();
|
|
|
+ const thisTag = exec('git describe --abbrev=0');
|
|
|
+ const prevTag = exec(`git describe --abbrev=0 --tags "${thisTag}^"`);
|
|
|
+ return exec(`git log --oneline --skip=1 --reverse "${prevTag}...${thisTag}"`)
|
|
|
+ .split('\n')
|
|
|
+ .map((str, i) => `${str.split(/\s/, 2)[1]}${10000 + i}\n${str}`)
|
|
|
+ .sort()
|
|
|
+ .map(str => str.split('\n')[1])
|
|
|
+ .join('\n');
|
|
|
+}
|