Skip to content

Commit d9f1efa

Browse files
author
RuzikNF
committed
build(npm): skip nodegui build, use open package
build(deb): update control data ci: remove upload build dir fix: remove useless logging deps: update
1 parent 15810c1 commit d9f1efa

File tree

10 files changed

+85
-413
lines changed

10 files changed

+85
-413
lines changed

.github/workflows/node.js.yml

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ jobs:
3030
env:
3131
SKIP_BUILD: 1
3232
run: npm ci
33-
- name: Upload build artifact
34-
uses: actions/upload-artifact@v2
35-
with:
36-
name: ${{ runner.os }} build
37-
path: ${{ github.workspace }}/dist
3833
- name: Pack binaries
3934
run: npm run package
4035
- name: Upload AppImage

.gitignore

+5-104
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,11 @@
1-
# Logs
2-
logs
31
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
482
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
663
*.tgz
4+
*.deb
675

68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
6+
node_modules
1057
deploy/*/build
106-
*.deb
1078
assets/fonts/whitney*
108-
dist/
109-
deb-struct/
110-
out/
9+
dist
10+
deb-struct
11+
out

.npmignore

-109
This file was deleted.

.npmrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# We skip build of NodeGui because we are providing our own prebuilt bins with downloadNodeGui.js.
2+
# P.S. Building takes a lot of time actually.
3+
4+
SKIP_BUILD=1

assets.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ declare module "*.png";
33
declare module "*.jpg";
44
declare module "*.jpeg";
55
declare module "*.gif";
6-
declare module "*.bmp";

build-deb.js

+26-36
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const fs = require("fs");
33
const process = require("child_process");
44

55
const CONFIG_FILE = path.join(__dirname, "deploy", "config.json");
6-
const { appName } = JSON.parse(fs.readFileSync(CONFIG_FILE, { encoding: 'utf8' }));
6+
const { appName } = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
77
const safeAppName = appName.replace(' ', '').toLowerCase();
88

99
const BUILD_DIR = path.join(__dirname, "deploy", "linux", "build", appName);
@@ -16,42 +16,32 @@ const paths = [
1616
'./deb-struct/usr/share/applications/',
1717
];
1818

19-
function cleanDirectories() {
20-
paths.forEach(dir => fs.mkdirSync(dir, {recursive: true}));
21-
paths.forEach(dir => process.execSync(`rm -rf ${dir}*`));
22-
}
23-
function copyControlFile() {
24-
console.log("Copying control...");
25-
process.execSync('cp ./control ./deb-struct/DEBIAN/control');
26-
}
27-
function copyBuildFolderToLib() {
28-
console.log("Copying build directory...");
29-
process.execSync(`cp -R "${BUILD_DIR}" "${LIB_DIR}"`);
30-
process.execSync(`cp -R ./assets "./deb-struct/usr/lib/${appName}"`);
31-
process.execSync(`mv "./deb-struct/usr/lib/${appName}" ./deb-struct/usr/lib/${safeAppName}`);
32-
}
33-
function createSymlinkToBin() {
34-
console.log("Copying symlink...");
35-
process.execSync(`ln -s /usr/lib/${safeAppName}/qode "${BIN_DIR}"`);
36-
}
37-
function copyDesktopFileToApplications() {
38-
console.log("Copying .desktop file...");
39-
const from = path.join(BUILD_DIR, getFilesFromPath(BUILD_DIR, ".desktop")[0]);
40-
const to = path.join(__dirname, 'deb-struct/usr/share/applications/', safeAppName + '.desktop')
41-
process.execSync(`cp "${from}" "${to}"`);
42-
}
43-
function createDeb() {
44-
console.log("Generating Debian package...");
45-
process.execSync("dpkg-deb --build deb-struct");
46-
process.execSync(`mv deb-struct.deb ${safeAppName}.deb`);
47-
}
4819
function getFilesFromPath(path, extension) {
4920
let files = fs.readdirSync(path);
5021
return files.filter(file => file.match(new RegExp(`.*\.(${extension})`, 'ig')));
5122
}
52-
cleanDirectories();
53-
copyControlFile();
54-
copyBuildFolderToLib();
55-
createSymlinkToBin();
56-
copyDesktopFileToApplications();
57-
createDeb();
23+
24+
console.log('Packaging DiscordQt into a Debian package...');
25+
26+
paths.forEach(dir => fs.mkdirSync(dir, {recursive: true}));
27+
paths.forEach(dir => process.execSync(`rm -rf ${dir}*`));
28+
29+
console.log("Copying control...");
30+
process.execSync('cp ./control ./deb-struct/DEBIAN/control');
31+
32+
console.log("Copying build directory...");
33+
process.execSync(`cp -R "${BUILD_DIR}" "${LIB_DIR}"`);
34+
process.execSync(`cp -R ./assets "./deb-struct/usr/lib/${appName}"`);
35+
process.execSync(`mv "./deb-struct/usr/lib/${appName}" ./deb-struct/usr/lib/${safeAppName}`);
36+
37+
console.log("Copying symlink...");
38+
process.execSync(`ln -s /usr/lib/${safeAppName}/qode "${BIN_DIR}"`);
39+
40+
console.log("Copying .desktop file...");
41+
const from = path.join(BUILD_DIR, getFilesFromPath(BUILD_DIR, ".desktop")[0]);
42+
const to = path.join(__dirname, 'deb-struct/usr/share/applications/', safeAppName + '.desktop')
43+
process.execSync(`cp "${from}" "${to}"`);
44+
45+
console.log("Generating Debian package...");
46+
process.execSync("dpkg-deb --build deb-struct");
47+
process.execSync(`mv deb-struct.deb ${safeAppName}.deb`);

control

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: discord-qt
2-
Version: 1.0
3-
Section: custom
2+
Version: 0.3.0
3+
Section: net
44
Priority: optional
5-
Architecture: all
6-
Essential: no
5+
Homepage: https://github.com/ruslang02/discord-qt
6+
Architecture: amd64
77
Installed-Size: 1024
8-
Maintainer: Ruslan Garifullin
9-
Description: Discord client in Qt
8+
Maintainer: Ruslan Garifullin <[email protected]>
9+
Description: Discord client in Qt.

0 commit comments

Comments
 (0)