Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
webblocksapp committed Aug 19, 2024
1 parent 127ec64 commit 86700c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ jobs:
body: 'Automatically generated release for version ${{ env.VERSION }}'
draft: false
prerelease: false
- name: Compress the .app bundle
run: |
cd ./apps/library-ui/dist/x64
zip -r Wine_Mac_Apps_x64.zip Wine\ Mac\ Apps.app
- name: Upload bundled files
if: steps.check_tag.outputs.result == 'proceed'
uses: actions/upload-release-asset@v1
Expand Down
26 changes: 16 additions & 10 deletions apps/library-ui/scripts/bundleMacApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
readdirSync,
writeFileSync,
} from 'fs';
import { execSync } from 'child_process';
import path from 'path';
import plist from 'plist';

Expand Down Expand Up @@ -63,17 +64,22 @@ const run = () => {
writeFileSync(APP_PLIST_PATH, infoPlistXML);
renameSync(APP_PATH, `${APP_PATH}.app`);

const files = readdirSync(DIST_FOLDER_PATH);
const filesToDelete = files.filter(
(file) => !FOLDERS_PATH_TO_KEEP.includes(file),
);

filesToDelete.forEach((file) => {
const filePath = path.join(DIST_FOLDER_PATH, file);
existsSync(filePath) &&
rmSync(filePath, { recursive: true, force: true });
});
const zipApp = `
cd ${DIST_FOLDER_PATH}/${SUFFIX} && zip -r Wine_Mac_Apps_${SUFFIX}.zip "${CFBundleName}.app"
`;
execSync(zipApp);
rmSync(APP_DOTAPP_PATH, { recursive: true, force: true });
}

const files = readdirSync(DIST_FOLDER_PATH);
const filesToDelete = files.filter(
(file) => !FOLDERS_PATH_TO_KEEP.includes(file),
);

filesToDelete.forEach((file) => {
const filePath = path.join(DIST_FOLDER_PATH, file);
existsSync(filePath) && rmSync(filePath, { recursive: true, force: true });
});
};

run();

0 comments on commit 86700c4

Please sign in to comment.