mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Added windows signing
This commit is contained in:
parent
3a9aedae31
commit
c5e78e390c
2 changed files with 15 additions and 13 deletions
|
@ -1,7 +1,9 @@
|
||||||
FROM node:22.10.0-bookworm
|
FROM node:22.10.0-bookworm
|
||||||
|
|
||||||
RUN dpkg --add-architecture i386
|
RUN dpkg --add-architecture i386
|
||||||
RUN apt update && apt install -y zip dpkg fakeroot rpm wget p7zip-full unzip rsync
|
RUN apt update && apt install -y zip dpkg fakeroot rpm wget p7zip-full unzip rsync jq awscli
|
||||||
|
RUN wget https://github.com/ebourg/jsign/releases/download/6.0/jsign_6.0_all.deb
|
||||||
|
RUN apt install -y ./jsign_6.0_all.deb
|
||||||
|
|
||||||
RUN mkdir -pm755 /etc/apt/keyrings
|
RUN mkdir -pm755 /etc/apt/keyrings
|
||||||
RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const yargs = require('yargs/yargs');
|
const yargs = require('yargs/yargs');
|
||||||
const { hideBin } = require('yargs/helpers');
|
const { hideBin } = require('yargs/helpers');
|
||||||
const { exec } = require('child_process');
|
const cp = require('child_process');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
// const extract = require('extract-zip')
|
// const extract = require('extract-zip')
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
||||||
const argv = yargs(hideBin(process.argv)).argv;
|
const argv = yargs(hideBin(process.argv)).argv;
|
||||||
const APPLICATION_NAME = 'fcast-receiver';
|
const APPLICATION_NAME = 'fcast-receiver';
|
||||||
const APPLICATION_TITLE = 'FCast Receiver';
|
const APPLICATION_TITLE = 'FCast Receiver';
|
||||||
|
const CI_SIGNING_DIR = '/deploy/signing';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
packagerConfig: {
|
packagerConfig: {
|
||||||
|
@ -106,6 +107,11 @@ module.exports = {
|
||||||
|
|
||||||
postPackage: async (config, packageResults) => {
|
postPackage: async (config, packageResults) => {
|
||||||
switch (packageResults.platform) {
|
switch (packageResults.platform) {
|
||||||
|
case "win32": {
|
||||||
|
const exePath = `./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}.exe`;
|
||||||
|
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${exePath}`)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "darwin": {
|
case "darwin": {
|
||||||
let artifactName = `${APPLICATION_NAME}.app`;
|
let artifactName = `${APPLICATION_NAME}.app`;
|
||||||
if (fs.existsSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${artifactName}`)) {
|
if (fs.existsSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${artifactName}`)) {
|
||||||
|
@ -130,7 +136,9 @@ module.exports = {
|
||||||
|
|
||||||
artifactName = `${APPLICATION_NAME}.msi`;
|
artifactName = `${APPLICATION_NAME}.msi`;
|
||||||
if (fs.existsSync(`./out/make/wix/${e.arch}/${artifactName}`)) {
|
if (fs.existsSync(`./out/make/wix/${e.arch}/${artifactName}`)) {
|
||||||
fs.renameSync(`./out/make/wix/${e.arch}/${artifactName}`, path.join(`./out/make/wix/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'msi')));
|
const artifactPath = path.join(`./out/make/wix/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'msi'));
|
||||||
|
fs.renameSync(`./out/make/wix/${e.arch}/${artifactName}`, artifactPath);
|
||||||
|
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${artifactPath}`)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -145,9 +153,8 @@ module.exports = {
|
||||||
console.log(`Making a zip distributable for ${e.platform}/${e.arch}`);
|
console.log(`Making a zip distributable for ${e.platform}/${e.arch}`);
|
||||||
const zipPath = path.resolve(process.cwd(), 'out', 'make', 'zip', e.platform, e.arch, generateArtifactName(e.packageJSON, e.platform, e.arch, 'zip'));
|
const zipPath = path.resolve(process.cwd(), 'out', 'make', 'zip', e.platform, e.arch, generateArtifactName(e.packageJSON, e.platform, e.arch, 'zip'));
|
||||||
|
|
||||||
exec(`mkdir -p ${path.dirname(zipPath)}`, execOutput);
|
console.log(cp.execSync(`mkdir -p ${path.dirname(zipPath)}`));
|
||||||
exec(`cd out/${APPLICATION_NAME}-${e.platform}-${e.arch}; zip -r -y "${zipPath}" "${APPLICATION_TITLE}.app"`, execOutput);
|
console.log(cp.execSync(`cd out/${APPLICATION_NAME}-${e.platform}-${e.arch}; zip -r -y "${zipPath}" "${APPLICATION_TITLE}.app"`));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "linux": {
|
case "linux": {
|
||||||
|
@ -208,13 +215,6 @@ module.exports = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
function execOutput(err, stdout, stderr) {
|
|
||||||
if (err) {
|
|
||||||
console.log(stderr);
|
|
||||||
}
|
|
||||||
console.log(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArtifactOS(platform) {
|
function getArtifactOS(platform) {
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue