Skip to content

Commit

Permalink
refactor: remove unused binaries (#110)
Browse files Browse the repository at this point in the history
The minified and 32bit binaries have not been in use for a while. As such this PR removes them.

BREAKING CHANGE: The minified and 32bit binaries are removed.
  • Loading branch information
kyubisation authored Nov 22, 2024
1 parent 6d3d153 commit 4620484
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- run: go version

- name: 'Build cli'
run: yarn build:cli:upx
run: yarn build:cli

- uses: actions/github-script@v6
with:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"scripts": {
"build:lib": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-lib.mts",
"build:cli": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-cli.mts",
"build:cli:upx": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-cli.mts upx",
"build:ngssc": "ng run ngssc-app:ngsscbuild:production",
"build:demo": "ng build ngssc-app",
"build:demo-i18n": "ng build ngssc-app -c i18n",
Expand Down
19 changes: 0 additions & 19 deletions scripts/build-cli.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ const dist = join(root, 'dist', 'cli');
const version = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).version;
const cliDirectory = join(root, 'cli');
const binaries: { os: string; arch: string; fileName: string, alias?: string }[] = [
{ os: 'windows', arch: '386', fileName: 'ngssc_32bit.exe' },
{ os: 'windows', arch: 'amd64', fileName: 'ngssc_amd64.exe', alias: 'ngssc_64bit.exe' },
{ os: 'linux', arch: '386', fileName: 'ngssc_32bit' },
{ os: 'linux', arch: 'amd64', fileName: 'ngssc_amd64', alias: 'ngssc_64bit' },
{ os: 'linux', arch: 'arm64', fileName: 'ngssc_arm64' },
{ os: 'darwin', arch: 'amd64', fileName: 'ngssc_darwin_amd64', alias: 'ngssc_darwin_64bit' },
{ os: 'darwin', arch: 'arm64', fileName: 'ngssc_darwin_arm64' },
];
const buildUpx = process.argv[2] === 'upx';

const asyncExec = promisify(exec);
await Promise.all(
Expand All @@ -40,22 +37,6 @@ await Promise.all(
await cp(binaryDist, join(dist, binary.alias));
console.log(`Created alias for ${binary.os} ${binary.arch}: ${binary.alias}`);
}

if (buildUpx) {
const [fileName, extension] = binary.fileName.split('.');
const minFileName = `${fileName}_min${extension ? `.${extension}` : ''}`;
const minBinaryDist = join(dist, minFileName);
console.log(`Building upx binary for ${binary.os} ${binary.arch}`);
await cp(binaryDist, minBinaryDist);
await asyncExec(`upx --brute ${minBinaryDist}`);
console.log(`Finished compressing binary for ${binary.os} ${binary.arch}: ${minFileName}`);
if (binary.alias) {
const [fileName, extension] = binary.alias.split('.');
const aliasFileName = `${fileName}_min${extension ? `.${extension}` : ''}`;
await cp(minBinaryDist, join(dist, aliasFileName));
console.log(`Created alias for compressed ${binary.os} ${binary.arch}: ${aliasFileName}`);
}
}
}),
);

Expand Down

0 comments on commit 4620484

Please sign in to comment.