Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: improve release process for beta branch (#3809)
- Loading branch information
Showing
7 changed files
with
153 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env node | ||
|
||
// Usage: autoFixConflicts.js | sh | ||
|
||
import { createInterface as readLines } from 'node:readline' | ||
import { spawn } from 'node:child_process' | ||
|
||
const VERSION_URL = /(?<=https:\/\/\S+\/v)\d+\.\d+\.\d+(?:-(?:alpha|beta)(?:[.-]\d+)?)?(?=\/)/ | ||
|
||
const gitStatus = spawn('git', ['status', '--porcelain']) | ||
|
||
for await (const line of readLines(gitStatus.stdout)) { | ||
// eslint-disable-next-line no-continue | ||
if (!line.startsWith('UU ')) continue | ||
|
||
const file = line.slice(3) | ||
if (file === 'yarn.lock') { | ||
console.log('corepack yarn install') | ||
console.log('git add yarn.lock') | ||
// eslint-disable-next-line no-continue | ||
continue | ||
} | ||
|
||
if (file.endsWith('/package.json')) { | ||
console.log(`git checkout --ours ${file}`) | ||
console.log(`git add ${file}`) | ||
// eslint-disable-next-line no-continue | ||
continue | ||
} | ||
|
||
const gitDiff = spawn('git', ['--no-pager', 'diff', '--', file]) | ||
let conflictHasStarted = false | ||
let containsCDNChanges = true | ||
let currentConflictContainsCDNChanges = false | ||
|
||
// eslint-disable-next-line no-shadow | ||
for await (const line of readLines(gitDiff.stdout)) { | ||
if (conflictHasStarted) { | ||
if (line.startsWith('++>>>>>>>')) { | ||
conflictHasStarted = false | ||
containsCDNChanges &&= currentConflictContainsCDNChanges | ||
currentConflictContainsCDNChanges = false | ||
} else { | ||
currentConflictContainsCDNChanges ||= VERSION_URL.test(line) | ||
} | ||
} else if (line === '++<<<<<<< HEAD') { | ||
conflictHasStarted = true | ||
} | ||
} | ||
if (containsCDNChanges) { | ||
console.log(`git checkout --ours ${file}`) | ||
console.log(`git add ${file}`) | ||
// eslint-disable-next-line no-continue | ||
continue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const REPO_OWNER = 'transloadit' | ||
export const REPO_NAME = 'uppy' | ||
export const TARGET_BRANCH = '3.x' | ||
export const STABLE_BRANCH = 'main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters