Skip to content

Commit

Permalink
Revert "refactor<chore>: remove build workflow workaround as it's bee…
Browse files Browse the repository at this point in the history
…n fixed on Tauri"

This reverts commit b7db463.
  • Loading branch information
kimlimjustin committed Dec 21, 2021
1 parent 543c360 commit 24501a4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
"prettier": "prettier --write src",
"grunt": "grunt",
"css:minify": "cleancss --batch --batch-suffix \"\" out/**/*.css ",
"prebuild": "yarn compile && yarn grunt && yarn css:minify",
"prebuild": "yarn compile && yarn grunt && yarn css:minify && node scripts/prepare_workflow.js",
"build": "tauri build",
"postbuild": "node scripts/after_workflow.js",
"postinstall": "husky install",
"fakefiles": "python scripts/generate-fake-files.py 1000"
},
Expand Down
14 changes: 14 additions & 0 deletions scripts/after_workflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Check if the workflow is run on GitHub Actions
if (process.env.GITHUB_ACTIONS === 'true') {
const fs = require('fs');
const path = require('path');
const tauriConf = require('../src-tauri/tauri.conf.json');
const spawn = require('cross-spawn');

tauriConf.tauri.bundle.windows.wix = {
template: './installer.wxs',
license: '../LICENSE',
};
fs.writeFileSync(path.join(__dirname, '../src-tauri/tauri.conf.json'), JSON.stringify(tauriConf, null, 2));
spawn('tauri', ['build']);
}
8 changes: 8 additions & 0 deletions scripts/prepare_workflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Check if the workflow is run on GitHub Actions
if (process.env.GITHUB_ACTIONS === 'true') {
const fs = require('fs');
const path = require('path');
const tauriConf = require('../src-tauri/tauri.conf.json');
delete tauriConf.tauri.bundle.windows['wix'];
fs.writeFileSync(path.join(__dirname, '../src-tauri/tauri.conf.json'), JSON.stringify(tauriConf, null, 2));
}

1 comment on commit 24501a4

@vercel
Copy link

@vercel vercel bot commented on 24501a4 Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.