2019-04-17 07:17:39 +02:00
|
|
|
/**
|
|
|
|
* @prettier
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const [, , /* node */ /* file */ tag] = process.argv;
|
|
|
|
|
|
|
|
const getStdin = require('get-stdin');
|
|
|
|
const Octokit = require('@octokit/rest');
|
|
|
|
const octokit = new Octokit({
|
|
|
|
auth: `token ${process.env.GITHUB_TOKEN}`,
|
|
|
|
});
|
|
|
|
|
|
|
|
const [repoOwner, repoName] = process.env.GITHUB_REPOSITORY.split('/');
|
|
|
|
|
|
|
|
getStdin()
|
2020-08-13 23:36:23 +02:00
|
|
|
.then((changelog) =>
|
2019-04-17 07:17:39 +02:00
|
|
|
octokit.repos.createRelease({
|
|
|
|
owner: repoOwner,
|
|
|
|
repo: repoName,
|
|
|
|
tag_name: tag,
|
|
|
|
body: changelog,
|
2021-03-10 22:08:25 +01:00
|
|
|
draft: false,
|
2019-04-17 07:17:39 +02:00
|
|
|
})
|
|
|
|
)
|
2020-08-13 23:36:23 +02:00
|
|
|
.catch((err) => {
|
2019-04-17 07:17:39 +02:00
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
});
|