2021-06-12 00:39:33 -05:00
|
|
|
import { Octokit } from '@octokit/rest';
|
|
|
|
|
|
|
|
const [, , /* node */ /* file */ tag] = process.argv;
|
2023-01-19 16:53:05 -05:00
|
|
|
// eslint-disable-next-line no-console
|
2021-06-12 00:39:33 -05:00
|
|
|
console.log('tag', tag);
|
|
|
|
|
|
|
|
const octokit = new Octokit({
|
|
|
|
auth: `token ${process.env.GITHUB_TOKEN}`,
|
|
|
|
});
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
try {
|
2023-01-19 16:53:05 -05:00
|
|
|
// eslint-disable-next-line no-console
|
2021-06-12 00:39:33 -05:00
|
|
|
await octokit.repos.createRelease({
|
2023-01-19 16:53:05 -05:00
|
|
|
owner: 'verdaccio',
|
|
|
|
repo: 'verdaccio',
|
2021-06-12 00:39:33 -05:00
|
|
|
tag_name: tag,
|
2023-02-14 16:32:40 -05:00
|
|
|
body: '## Release /n TBA',
|
2023-01-19 16:53:05 -05:00
|
|
|
draft: true,
|
2021-06-12 00:39:33 -05:00
|
|
|
discussion_category_name: 'Announcements',
|
|
|
|
});
|
|
|
|
} catch (err) {
|
|
|
|
// eslint-disable-next-line no-console
|
2023-01-19 16:53:05 -05:00
|
|
|
console.error(`release script has failed, details: ${err}`);
|
2021-06-12 00:39:33 -05:00
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
})();
|