Skip to content

Commit e9e4885

Browse files
committed
Cope with funky out-of-band releases' file naming scheme
Regular Git for Windows releases are based on upstream Git releases, and follow the version number pattern 2.MAJOR.MINOR. For Git for Windows releases that are _not_ based on upstream Git releases ("out-of-band releases"), a number is appended in parentheses, starting with the number 2. The intention was to write corresponding `announcement` and `release-notes` files using a more file-system-friendly pattern that simply appends a dot and that number. This is what the `release-git` workflow expects. However, in the first out-of-band release since switching Git for Windows' release automation from Azure Pipelines to GitHub workflows, it occurs that the announcement and release note files' names are written unexpectedly with parentheses. Let's just apply Postel's Law here and just rename those files to the expected kind of file names. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 65a23e2 commit e9e4885

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

github-release.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ const downloadBundleArtifacts = async (context, token, owner, repo, git_artifact
134134

135135
fs.writeFileSync('bundle-artifacts/sha256sums', checksums)
136136

137+
// Work around out-of-band versions' announcement file containing parentheses
138+
const withParens = result.ver.replace(/^(\d+\.\d+\.\d+)\.(\d+)$/, '$1($2)')
139+
console.log(`withParens: ${withParens}`)
140+
if (result.ver !== withParens) {
141+
if (!fs.existsSync(`bundle-artifacts/announce-${result.ver}`)) {
142+
fs.renameSync(`bundle-artifacts/announce-${withParens}`, `bundle-artifacts/announce-${result.ver}`)
143+
}
144+
if (!fs.existsSync(`bundle-artifacts/release-notes-${result.ver}`)) {
145+
fs.renameSync(`bundle-artifacts/release-notes-${withParens}`, `bundle-artifacts/release-notes-${result.ver}`)
146+
}
147+
}
148+
137149
result.announcement = fs
138150
.readFileSync(`bundle-artifacts/announce-${result.ver}`)
139151
.toString()

0 commit comments

Comments
 (0)