Skip to content

Commit

Permalink
Revert "chore: ensure build the is reproducible (#2406)" (#2428)
Browse files Browse the repository at this point in the history
This reverts commit c81b9b3.
  • Loading branch information
vvvvvv1vvvvvv authored Jul 23, 2024
1 parent 5e990d6 commit 4bb3fe4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 714 deletions.
19 changes: 6 additions & 13 deletions build/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const { prompt, BooleanPrompt } = require('enquirer');
const fs = require('fs-extra');
const shell = require('shelljs');
const pkg = require('../package.json');
const zipdir = require('zip-dir');

const PROJECT_ROOT = path.resolve(__dirname, '..');

Expand Down Expand Up @@ -30,16 +30,10 @@ async function release([version, isDebug, isRelease]) {
}

async function bundle() {
const oldVersion = pkg.version;
const plus1Version = oldVersion
.split('.')
.map((v, i) => (i === 2 ? +v + 1 : v))
.join('.');
const { version } = await prompt({
type: 'input',
name: 'version',
message: '[Rabby] Please input the release version:',
initial: plus1Version,
});

const isMV3 = await new BooleanPrompt({
Expand All @@ -58,7 +52,7 @@ async function bundle() {

updateManifestVersion(version, 'mv3');
updateManifestVersion(version, 'mv2');
// shell.env['sourcemap'] = true;
shell.env['sourcemap'] = true;
if (isMV3) {
shell.exec(`cross-env VERSION=${version} yarn ${buildStr}`);
} else {
Expand All @@ -67,12 +61,11 @@ async function bundle() {
shell.rm('-rf', './dist/*.js.map');
return [version, isDebug, isRelease];
}

async function packed([version, isDebug]) {
import('./zip.mjs').then((re) => {
re.createZipTask(
'dist/**',
`Rabby_v${version}${isDebug ? '_debug' : ''}.zip`
);
const distPath = path.resolve(PROJECT_ROOT, 'dist');
return zipdir(distPath, {
saveTo: `Rabby_v${version}${isDebug ? '_debug' : ''}.zip`,
});
}

Expand Down
15 changes: 0 additions & 15 deletions build/zip.mjs

This file was deleted.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@
"eslint-webpack-plugin": "2.5.4",
"file-loader": "6.2.0",
"fs-extra": "10.0.0",
"gulp": "5.0.0",
"gulp-sort": "2.0.0",
"gulp-zip": "6.0.0",
"html-webpack-plugin": "5.3.1",
"i18next": "23.4.1",
"jest": "29.7.0",
Expand Down Expand Up @@ -217,7 +214,8 @@
"webpack-bundle-analyzer": "4.4.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.7.4",
"webpack-merge": "5.7.3"
"webpack-merge": "5.7.3",
"zip-dir": "2.0.0"
},
"resolutions": {
"@debank/common": "^0.3.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/pack-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ git_committish=$(git log --format="%h" -n 1)

pack_dist() {
rm -rf ./tmp/ && mkdir -p ./tmp/ && \
zip -rX ./tmp/Rabby_v${app_ver}_debug.${git_committish}.zip ./dist
zip -r ./tmp/Rabby_v${app_ver}_debug.${git_committish}.zip ./dist
}

build() {
Expand All @@ -30,4 +30,4 @@ case $systype in
MSYS_NT*|MINGW*)
start "" .\\tmp
;;
esac
esac
Loading

0 comments on commit 4bb3fe4

Please sign in to comment.