Skip to content

Commit e01e5af

Browse files
committed
chore(package): handle deprecated tar.gz
1 parent 8e1140e commit e01e5af

File tree

3 files changed

+78
-63
lines changed

3 files changed

+78
-63
lines changed

build_tools/upload-github-release.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require('fs');
22
const path = require('path');
33

44
const AdmZip = require('adm-zip');
5-
const TarGz = require('tar.gz');
5+
const Tar = require('tar');
66
const publishRelease = require('publish-release');
77
const inquirer = require('inquirer');
88

@@ -37,16 +37,13 @@ const buildZipArchive = ({lookupDir, archiveFilePath}) => {
3737

3838
// Build archive type .tar.gz
3939
const buildTarGzArchive = ({lookupDir, archiveFilePath}) => {
40-
let gzipOptions = {
41-
level : 9,
42-
memLevel : 9,
43-
};
44-
let tarOptions = {
45-
fromBase : true
46-
};
47-
return new TarGz(gzipOptions, tarOptions)
48-
.compress(lookupDir, archiveFilePath)
49-
.then(() => archiveFilePath);
40+
return Tar.c({
41+
gzip : true,
42+
file : archiveFilePath,
43+
cwd : path.normalize(path.join(__dirname, '..')),
44+
},
45+
[lookupDir])
46+
.then(() => archiveFilePath)
5047
};
5148

5249
// Upload and apply release
@@ -96,7 +93,7 @@ Promise.all([
9693
getChangelog(changelogFilePath, pkg.version),
9794
Promise.all([
9895
buildZipArchive({lookupDir : dirDir, archiveFilePath : `${tmpDir}/${pkg.name}-${pkg.version}.zip`}),
99-
buildTarGzArchive({lookupDir : dirDir, archiveFilePath : `${tmpDir}/${pkg.name}-${pkg.version}.tar.gz`}),
96+
buildTarGzArchive({lookupDir : 'dist', archiveFilePath : `${tmpDir}/${pkg.name}-${pkg.version}.tar.gz`}),
10097
])
10198
])
10299
.then(([changelog, assets]) => {

package-lock.json

Lines changed: 68 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"publish-release": "^1.6.0",
100100
"pug": "^2.0.3",
101101
"serve-favicon": "^2.5.0",
102-
"tar.gz": "^1.0.5"
102+
"tar": "^4.4.10"
103103
},
104104
"dependencies": {
105105
"angular": "^1.7.8"

0 commit comments

Comments
 (0)