Skip to content

Commit d4625b8

Browse files
authored
feat: support alpha versions (#107)
Node.js 27 introduces Alpha releases versioned as vN.0.0-alpha.X.Y.Z (see nodejs/node#63135). Recognise them in directory names and release asset file names, like release candidates. Refs: nodejs/Release#1187 Signed-off-by: RafaelGSS <[email protected]>
1 parent c4568d2 commit d4625b8

4 files changed

Lines changed: 22 additions & 3 deletions

File tree

‎src/decode-ref.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const dirre = /^(v\d+\.\d+\.\d+(?:-rc\.\d+)?)(?:-((?:next-)?nightly|test|v8-canary)\d{8}(\w+))?$/ // get version or commit from dir name
1+
const dirre = /^(v\d+\.\d+\.\d+(?:-rc\.\d+|-alpha\.\d+\.\d+\.\d+)?)(?:-((?:next-)?nightly|test|v8-canary)\d{8}(\w+))?$/ // get version or commit from dir name
22

33
function decodeRef (dir) {
44
const m = dir.match(dirre)

‎src/transform-filename.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const types = {
4848
}
4949

5050
function transformFilename (file) {
51-
file = file && file.replace(/^(?:\.\/)?(?:iojs|node)-v\d+\.\d+\.\d+-?((rc\.\d+|(?:(next-)?nightly|test|v8-canary)\d{8}[^-.]+)-?)?\.?/, '')
51+
file = file && file.replace(/^(?:\.\/)?(?:iojs|node)-v\d+\.\d+\.\d+-?((rc\.\d+|alpha\.\d+\.\d+\.\d+|(?:(next-)?nightly|test|v8-canary)\d{8}[^-.]+)-?)?\.?/, '')
5252
.replace(/\.tar\.gz$/, '')
5353

5454
return types[file]

‎test/decode-ref.test.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ const tests = [
99
{ dir: 'v2.3.1-next-nightly201506308f6f4280c6', ref: 'node/8f6f4280c6' },
1010
{ dir: 'v3.0.0-rc.1', ref: 'node/v3.0.0-rc.1' },
1111
{ dir: 'v33.22.1-rc.111', ref: 'node/v33.22.1-rc.111' },
12+
{ dir: 'v27.0.0-alpha.0.0.0', ref: 'node/v27.0.0-alpha.0.0.0' },
13+
{ dir: 'v27.0.0-alpha.1.10.2', ref: 'node/v27.0.0-alpha.1.10.2' },
1214
{ dir: 'v0.6.1', ref: 'node/v0.6.1' },
1315
{ dir: 'v0.5.1', ref: 'node/v0.5.1' },
1416
{ dir: 'v6.0.0-test20151107093b0e865c', ref: 'node/093b0e865c' },
15-
{ dir: 'v9.0.0-v8-canary20170609cd40078f1f', ref: 'v8-canary/cd40078f1f' }
17+
{ dir: 'v9.0.0-v8-canary20170609cd40078f1f', ref: 'v8-canary/cd40078f1f' },
18+
{ dir: 'v27.0.0-alpha.0.0', ref: null },
19+
{ dir: 'v27.0.0-alpha', ref: null }
1620
]
1721

1822
describe('decodeRef', () => {

‎test/transform-filename.test.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ const tests = [
7474
{ file: 'iojs-v3.0.0-rc.1.tar.xz' },
7575
{ file: 'iojs-v3.0.0-rc.1-x64.msi', type: 'win-x64-msi' },
7676
{ file: 'iojs-v3.0.0-rc.1-x86.msi', type: 'win-x86-msi' },
77+
{ file: 'node-v27.0.0-alpha.0.0.0-darwin-arm64.tar.gz', type: 'osx-arm64-tar' },
78+
{ file: 'node-v27.0.0-alpha.0.0.0-darwin-arm64.tar.xz' },
79+
{ file: 'node-v27.0.0-alpha.0.0.0-headers.tar.gz', type: 'headers' },
80+
{ file: 'node-v27.0.0-alpha.0.0.0-headers.tar.xz' },
81+
{ file: 'node-v27.0.0-alpha.0.0.0-linux-x64.tar.gz', type: 'linux-x64' },
82+
{ file: 'node-v27.0.0-alpha.0.0.0-linux-x64.tar.xz' },
83+
{ file: 'node-v27.0.0-alpha.0.0.0-linux-arm64.tar.gz', type: 'linux-arm64' },
84+
{ file: 'node-v27.0.0-alpha.0.0.0-linux-arm64.tar.xz' },
85+
{ file: 'node-v27.0.0-alpha.0.0.0.pkg', type: 'osx-x64-pkg' },
86+
{ file: 'node-v27.0.0-alpha.0.0.0.tar.gz', type: 'src' },
87+
{ file: 'node-v27.0.0-alpha.0.0.0.tar.xz' },
88+
{ file: 'node-v27.0.0-alpha.0.0.0-x64.msi', type: 'win-x64-msi' },
89+
{ file: 'node-v27.0.0-alpha.0.0.0-win-x64.zip', type: 'win-x64-zip' },
90+
{ file: 'node-v27.0.0-alpha.0.0.0-win-x64.7z', type: 'win-x64-7z' },
91+
{ file: 'node-v27.0.0-alpha.1.10.2-linux-x64.tar.gz', type: 'linux-x64' },
7792
{ file: 'SHASUMS256.txt' },
7893
{ file: 'win-x64/iojs.exe', type: 'win-x64-exe' },
7994
{ file: 'win-x86/iojs.exe', type: 'win-x86-exe' },

0 commit comments

Comments
 (0)