build: cleanup release scripts, separate cli entrypoints from logic (#44082)
* build: cleanup release scripts, separate cli entrypoints from logic Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * build: use repo/org constants Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
7b14a305f8
commit
6074f7ed31
17 changed files with 410 additions and 300 deletions
|
@ -10,8 +10,10 @@ import { get, render } from './notes';
|
|||
import { Octokit } from '@octokit/rest';
|
||||
import { createGitHubTokenStrategy } from '../github-token';
|
||||
import { parseArgs } from 'node:util';
|
||||
import { ELECTRON_ORG, ELECTRON_REPO } from '../types';
|
||||
|
||||
const octokit = new Octokit({
|
||||
authStrategy: createGitHubTokenStrategy('electron')
|
||||
authStrategy: createGitHubTokenStrategy(ELECTRON_REPO)
|
||||
});
|
||||
|
||||
const semverify = (version: string) => version.replace(/^origin\//, '').replace(/[xy]/g, '0').replace(/-/g, '.');
|
||||
|
@ -45,8 +47,8 @@ const getTagsOf = async (point: string) => {
|
|||
|
||||
const getTagsOnBranch = async (point: string) => {
|
||||
const { data: { default_branch: defaultBranch } } = await octokit.repos.get({
|
||||
owner: 'electron',
|
||||
repo: 'electron'
|
||||
owner: ELECTRON_ORG,
|
||||
repo: ELECTRON_REPO
|
||||
});
|
||||
const mainTags = await getTagsOf(defaultBranch);
|
||||
if (point === defaultBranch) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue