@goreleaser/goreleaser 2.10.2 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/lib.js +49 -9
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
<h3 align="center">GoReleaser</h3>
|
|
4
4
|
<p align="center">Release engineering, simplified.</p>
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img alt="Go" src="./www/docs/static/go-light.svg#gh-light-mode-only" height="60" />
|
|
7
|
-
<img alt="Go" src="./www/docs/static/go-dark.svg#gh-dark-mode-only" height="60" />
|
|
8
|
-
<img alt="Rust" src="./www/docs/static/rust-light.svg#gh-light-mode-only" height="60" />
|
|
9
|
-
<img alt="Rust" src="./www/docs/static/rust-dark.svg#gh-dark-mode-only" height="60" />
|
|
10
|
-
<img alt="Zig" src="./www/docs/static/zig-light.svg#gh-light-mode-only" height="60" />
|
|
11
|
-
<img alt="Zig" src="./www/docs/static/zig-dark.svg#gh-dark-mode-only" height="60" />
|
|
12
|
-
<img alt="Bun" src="./www/docs/static/bun-light.svg#gh-light-mode-only" height="60" />
|
|
13
|
-
<img alt="Bun" src="./www/docs/static/bun-dark.svg#gh-dark-mode-only" height="60" />
|
|
14
|
-
<img alt="Deno" src="./www/docs/static/deno-light.svg#gh-light-mode-only" height="60" />
|
|
15
|
-
<img alt="Deno" src="./www/docs/static/deno-dark.svg#gh-dark-mode-only" height="60" />
|
|
16
|
-
<img alt="Python" src="./www/docs/static/python-light.svg#gh-light-mode-only" height="60" />
|
|
17
|
-
<img alt="Python" src="./www/docs/static/python-dark.svg#gh-dark-mode-only" height="60" />
|
|
6
|
+
<img alt="Go" src="./www/docs/static/go-light.svg#gh-light-mode-only" height="60" width="60" />
|
|
7
|
+
<img alt="Go" src="./www/docs/static/go-dark.svg#gh-dark-mode-only" height="60" width="60" />
|
|
8
|
+
<img alt="Rust" src="./www/docs/static/rust-light.svg#gh-light-mode-only" height="60" width="60" />
|
|
9
|
+
<img alt="Rust" src="./www/docs/static/rust-dark.svg#gh-dark-mode-only" height="60" width="60" />
|
|
10
|
+
<img alt="Zig" src="./www/docs/static/zig-light.svg#gh-light-mode-only" height="60" width="60" />
|
|
11
|
+
<img alt="Zig" src="./www/docs/static/zig-dark.svg#gh-dark-mode-only" height="60" width="60" />
|
|
12
|
+
<img alt="Bun" src="./www/docs/static/bun-light.svg#gh-light-mode-only" height="60" width="60" />
|
|
13
|
+
<img alt="Bun" src="./www/docs/static/bun-dark.svg#gh-dark-mode-only" height="60" width="60" />
|
|
14
|
+
<img alt="Deno" src="./www/docs/static/deno-light.svg#gh-light-mode-only" height="60" width="60" />
|
|
15
|
+
<img alt="Deno" src="./www/docs/static/deno-dark.svg#gh-dark-mode-only" height="60" width="60" />
|
|
16
|
+
<img alt="Python" src="./www/docs/static/python-light.svg#gh-light-mode-only" height="60" width="60" />
|
|
17
|
+
<img alt="Python" src="./www/docs/static/python-dark.svg#gh-dark-mode-only" height="60" width="60" />
|
|
18
18
|
</p>
|
|
19
19
|
</p>
|
|
20
20
|
|
package/lib.js
CHANGED
|
@@ -19,31 +19,61 @@ const getArchive = () => {
|
|
|
19
19
|
|
|
20
20
|
const binDir = path.join(__dirname, "bin");
|
|
21
21
|
|
|
22
|
-
async function extractTar(tarPath, binaries, dir) {
|
|
22
|
+
async function extractTar(tarPath, binaries, dir, wrappedIn) {
|
|
23
23
|
try {
|
|
24
|
+
const filesToExtract = wrappedIn
|
|
25
|
+
? binaries.map((bin) =>
|
|
26
|
+
path.join(wrappedIn, bin).replace(/\\/g, "/"),
|
|
27
|
+
)
|
|
28
|
+
: binaries;
|
|
29
|
+
|
|
24
30
|
await tar.x({
|
|
25
31
|
file: tarPath,
|
|
26
32
|
cwd: dir,
|
|
27
|
-
filter: (path) =>
|
|
33
|
+
filter: (path) => filesToExtract.includes(path),
|
|
28
34
|
});
|
|
29
|
-
|
|
35
|
+
|
|
36
|
+
// If wrapped, move files from wrapped directory to bin directory
|
|
37
|
+
if (wrappedIn) {
|
|
38
|
+
const wrappedDir = path.join(dir, wrappedIn);
|
|
39
|
+
for (const binary of binaries) {
|
|
40
|
+
const srcPath = path.join(wrappedDir, binary);
|
|
41
|
+
const destPath = path.join(dir, binary);
|
|
42
|
+
if (fs.existsSync(srcPath)) {
|
|
43
|
+
fs.renameSync(srcPath, destPath);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Clean up empty wrapped directory
|
|
47
|
+
try {
|
|
48
|
+
fs.rmSync(wrappedDir, { recursive: true, force: true });
|
|
49
|
+
} catch (err) {
|
|
50
|
+
// Ignore cleanup errors
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log(`Successfully extracted ${binaries} to "${dir}"`);
|
|
30
55
|
} catch (err) {
|
|
31
56
|
throw new Error(`Extraction failed: ${err.message}`);
|
|
32
57
|
}
|
|
33
58
|
}
|
|
34
59
|
|
|
35
|
-
async function extractZip(zipPath, binaries, dir) {
|
|
60
|
+
async function extractZip(zipPath, binaries, dir, wrappedIn) {
|
|
36
61
|
try {
|
|
37
62
|
const zipData = fs.readFileSync(zipPath);
|
|
38
63
|
const zip = await JSZip.loadAsync(zipData);
|
|
64
|
+
|
|
39
65
|
for (const binary of binaries) {
|
|
40
|
-
|
|
66
|
+
const binaryPath = wrappedIn
|
|
67
|
+
? path.join(wrappedIn, binary).replace(/\\/g, "/")
|
|
68
|
+
: binary;
|
|
69
|
+
|
|
70
|
+
if (!zip.files[binaryPath]) {
|
|
41
71
|
throw new Error(
|
|
42
|
-
`Error: ${
|
|
72
|
+
`Error: ${binaryPath} does not exist in ${zipPath}`,
|
|
43
73
|
);
|
|
44
74
|
}
|
|
45
75
|
|
|
46
|
-
const content = await zip.files[
|
|
76
|
+
const content = await zip.files[binaryPath].async("nodebuffer");
|
|
47
77
|
if (!fs.existsSync(dir)) {
|
|
48
78
|
fs.mkdirSync(dir, { recursive: true });
|
|
49
79
|
}
|
|
@@ -94,11 +124,21 @@ const install = async () => {
|
|
|
94
124
|
fs.chmodSync(bin, 0o755);
|
|
95
125
|
return;
|
|
96
126
|
case "zip":
|
|
97
|
-
return extractZip(
|
|
127
|
+
return extractZip(
|
|
128
|
+
archivePath,
|
|
129
|
+
archive.bins,
|
|
130
|
+
binDir,
|
|
131
|
+
archive.wrappedIn,
|
|
132
|
+
);
|
|
98
133
|
case "tar":
|
|
99
134
|
case "tar.gz":
|
|
100
135
|
case "tgz":
|
|
101
|
-
return extractTar(
|
|
136
|
+
return extractTar(
|
|
137
|
+
archivePath,
|
|
138
|
+
archive.bins,
|
|
139
|
+
binDir,
|
|
140
|
+
archive.wrappedIn,
|
|
141
|
+
);
|
|
102
142
|
case "tar.zst":
|
|
103
143
|
case "tzst":
|
|
104
144
|
case "tar.xz":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goreleaser/goreleaser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"description": "Release engineering, simplified",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node install.js",
|
|
@@ -37,74 +37,74 @@
|
|
|
37
37
|
"archives": {
|
|
38
38
|
"darwin-arm64": {
|
|
39
39
|
"name": "goreleaser_Darwin_arm64.tar.gz",
|
|
40
|
-
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.
|
|
40
|
+
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.11.1/goreleaser_Darwin_arm64.tar.gz",
|
|
41
41
|
"bins": [
|
|
42
42
|
"goreleaser"
|
|
43
43
|
],
|
|
44
44
|
"format": "tar.gz",
|
|
45
45
|
"checksum": {
|
|
46
46
|
"algorithm": "sha256",
|
|
47
|
-
"digest": "
|
|
47
|
+
"digest": "b1cfa3a0ade75e7a5d8ccd81219675999b9976f26f133c6a4d12aa80145a88e9"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"darwin-x64": {
|
|
51
51
|
"name": "goreleaser_Darwin_x86_64.tar.gz",
|
|
52
|
-
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.
|
|
52
|
+
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.11.1/goreleaser_Darwin_x86_64.tar.gz",
|
|
53
53
|
"bins": [
|
|
54
54
|
"goreleaser"
|
|
55
55
|
],
|
|
56
56
|
"format": "tar.gz",
|
|
57
57
|
"checksum": {
|
|
58
58
|
"algorithm": "sha256",
|
|
59
|
-
"digest": "
|
|
59
|
+
"digest": "0ab78afc49884c9f65f5a63273470058337d8b1ff5b335b9727d1f32f83ad6b6"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"linux-arm64": {
|
|
63
63
|
"name": "goreleaser_Linux_arm64.tar.gz",
|
|
64
|
-
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.
|
|
64
|
+
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.11.1/goreleaser_Linux_arm64.tar.gz",
|
|
65
65
|
"bins": [
|
|
66
66
|
"goreleaser"
|
|
67
67
|
],
|
|
68
68
|
"format": "tar.gz",
|
|
69
69
|
"checksum": {
|
|
70
70
|
"algorithm": "sha256",
|
|
71
|
-
"digest": "
|
|
71
|
+
"digest": "f0d3085a62898bf562177e5e5199dd83965df5f0495b9fb495559ac06d83ed9d"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"linux-x64": {
|
|
75
75
|
"name": "goreleaser_Linux_x86_64.tar.gz",
|
|
76
|
-
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.
|
|
76
|
+
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.11.1/goreleaser_Linux_x86_64.tar.gz",
|
|
77
77
|
"bins": [
|
|
78
78
|
"goreleaser"
|
|
79
79
|
],
|
|
80
80
|
"format": "tar.gz",
|
|
81
81
|
"checksum": {
|
|
82
82
|
"algorithm": "sha256",
|
|
83
|
-
"digest": "
|
|
83
|
+
"digest": "a01e2e9b72d9ee922361ef05263cf6fa77db4686df861b2b0d43713919c495c0"
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"win32-arm64": {
|
|
87
87
|
"name": "goreleaser_Windows_arm64.zip",
|
|
88
|
-
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.
|
|
88
|
+
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.11.1/goreleaser_Windows_arm64.zip",
|
|
89
89
|
"bins": [
|
|
90
90
|
"goreleaser.exe"
|
|
91
91
|
],
|
|
92
92
|
"format": "zip",
|
|
93
93
|
"checksum": {
|
|
94
94
|
"algorithm": "sha256",
|
|
95
|
-
"digest": "
|
|
95
|
+
"digest": "358235a0d20c438468508ad59f0739badde1cc6f91de8bccd10f6b3d7e5d3fd1"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"win32-x64": {
|
|
99
99
|
"name": "goreleaser_Windows_x86_64.zip",
|
|
100
|
-
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.
|
|
100
|
+
"url": "https://github.com/goreleaser/goreleaser/releases/download/v2.11.1/goreleaser_Windows_x86_64.zip",
|
|
101
101
|
"bins": [
|
|
102
102
|
"goreleaser.exe"
|
|
103
103
|
],
|
|
104
104
|
"format": "zip",
|
|
105
105
|
"checksum": {
|
|
106
106
|
"algorithm": "sha256",
|
|
107
|
-
"digest": "
|
|
107
|
+
"digest": "7ef5ee78a55bfc24107b5e8815ef83d6784cb548ff6a558d6d05d077a2e7ff1e"
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|