Skip to content

Commit 1b3d72e

Browse files
committed
うごかなくなったので、既知動作版 5573ff8 に復元
1 parent faa1afd commit 1b3d72e

5 files changed

Lines changed: 37 additions & 166 deletions

File tree

.github/workflows/compile-and-release.yml

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -105,34 +105,11 @@ jobs:
105105

106106
- name: Build for Platform
107107
run: grunt build
108-
# Bound the step so a stalled @electron/packager fails fast instead of hanging for hours,
109-
# and turn on packager/prune debug logging so the CI log shows exactly which step stalls
110-
# (download, extract, copy, prune/galactus tree walk, asar, or move).
111-
timeout-minutes: 25
112-
env:
113-
DEBUG: electron-packager,extract-zip,galactus,flora-colossus
114-
115-
- name: List build output (debug)
116-
if: always()
117-
shell: bash
118-
run: |
119-
echo "=== workspace: $(pwd) ==="
120-
echo "=== dist/install (recursive) ==="
121-
ls -laR dist/install 2>/dev/null || echo "(no dist/install directory)"
122-
echo "=== dist/pack subdirs (top level) ==="
123-
for d in dist/pack/*/; do echo "-- $d"; ls -la "$d" 2>/dev/null | head -30; done 2>/dev/null || echo "(no dist/pack)"
124108

125109
- name: Verify macOS arm64 DMG symlinks
126110
if: runner.os == 'macOS'
127111
shell: bash
128112
run: |
129-
# Informational post-build check of the already-produced arm64 .dmg. `grunt build`
130-
# has already fixed the framework symlinks and ad-hoc signed the app
131-
# (grunt/fix-macos-symlinks.js), so this step only reports status and must NOT fail the
132-
# release. The default `shell: bash` runs with `-e -o pipefail`; without `set +e` a flaky
133-
# `hdiutil detach` (resource busy) or an advisory codesign/spctl result would abort the
134-
# whole job even though the .dmg is valid.
135-
set +e
136113
DMG=$(ls ./dist/install/darwin/firebot-v*-macos-arm64.dmg 2>/dev/null || echo "")
137114
if [ -z "$DMG" ]; then
138115
echo "arm64 DMG not found - skipping verification"
@@ -147,26 +124,11 @@ jobs:
147124
echo "arm64 - Versions/Current -> $CUR"
148125
echo "arm64 - Electron Framework -> $EF"
149126
150-
# Code signature / Gatekeeper checks are advisory: the app is ad-hoc signed (no Apple
151-
# Developer ID / notarization), so codesign may report issues and spctl always rejects.
152-
echo "Verifying code signature (advisory)..."
153-
codesign --verify --deep --strict --verbose=2 "$MOUNT/Firebot.app" \
154-
&& echo "codesign: valid" \
155-
|| echo "codesign: reported issues (expected for ad-hoc build)"
127+
hdiutil detach "$MOUNT"
156128
157-
echo "Assessing with Gatekeeper (advisory)..."
158-
spctl --assess --verbose=2 "$MOUNT/Firebot.app" \
159-
&& echo "spctl: accepted" \
160-
|| echo "spctl: rejected (expected for an un-notarized ad-hoc build)"
161-
162-
hdiutil detach "$MOUNT" || hdiutil detach "$MOUNT" -force || true
163-
164-
if [ "$CUR" = "A" ] && [ "$EF" = "Versions/Current/Electron Framework" ]; then
165-
echo "✓ arm64 DMG symlink check passed"
166-
else
167-
echo "⚠ arm64 DMG symlinks unexpected (Versions/Current='$CUR', Electron Framework='$EF') - reporting only, not failing the build"
168-
fi
169-
exit 0
129+
test "$CUR" = "A" || (echo "ERROR: Versions/Current is not relative to A" && exit 1)
130+
test "$EF" = "Versions/Current/Electron Framework" || (echo "ERROR: Electron Framework symlink is broken" && exit 1)
131+
echo "✓ arm64 DMG symlinks verified successfully"
170132
171133
- name: Upload Artifacts
172134
uses: actions/upload-artifact@v4
@@ -197,15 +159,12 @@ jobs:
197159
name: Release v${{ needs.checkversion.outputs.version }}
198160
body: ${{ format(needs.checkversion.outputs.template, needs.checkversion.outputs.version, needs.checkversion.outputs.commits) }}
199161
generate_release_notes: false
200-
# Use wildcards instead of exact version strings: Squirrel normalizes the .nupkg version
201-
# (drops the "+9" build metadata, so firebot-5.66.5-full.nupkg, not firebot-5.66.5+9-...),
202-
# and matching by extension is robust to any version-string differences between tools.
203162
files: |
204-
./bundles/Windows/*-setup.exe
205-
./bundles/Windows/*-full.nupkg
163+
./bundles/Windows/firebot-v${{ needs.checkversion.outputs.version }}-setup.exe
164+
./bundles/Windows/firebot-${{ needs.checkversion.outputs.version }}-full.nupkg
206165
./bundles/Windows/RELEASES
207-
./bundles/Linux/*-linux-x64.tar.gz
208-
./bundles/Linux/*-linux-x64.deb
209-
./bundles/Linux/*-linux-x64.rpm
210-
./bundles/macOS/*-macos-x64.dmg
211-
./bundles/macOS/*-macos-arm64.dmg
166+
./bundles/Linux/firebot-v${{ needs.checkversion.outputs.version }}-linux-x64.tar.gz
167+
./bundles/Linux/firebot-v${{ needs.checkversion.outputs.version }}-linux-x64.deb
168+
./bundles/Linux/firebot-v${{ needs.checkversion.outputs.version }}-linux-x64.rpm
169+
./bundles/macOS/firebot-v${{ needs.checkversion.outputs.version }}-macos-x64.dmg
170+
./bundles/macOS/firebot-v${{ needs.checkversion.outputs.version }}-macos-arm64.dmg

grunt/compile.js

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function (grunt) {
2828
const linuxInstallerConfig = {
2929
src: "dist/pack/Firebot-linux-x64",
3030
dest: "dist/install/Linux",
31-
bin: "firebot",
31+
bin: "Firebot v5",
3232
options: {
3333
productName: "Firebot v5",
3434
genericName: "Firebot v5",
@@ -132,46 +132,11 @@ module.exports = function (grunt) {
132132
createDmg().then(done, done);
133133
});
134134

135-
// electron-installer-debian/-redhat need `bin` to match the executable electron-packager
136-
// actually produced in the pack dir. The name is *supposed* to be "firebot" (grunt/pack.js
137-
// passes --executable-name="firebot"), but native-Linux CI runs have produced a differently
138-
// named/laid-out binary than local cross-platform packs. Rather than hardcode a guess, detect
139-
// the real Electron binary and log the directory so CI failures are diagnosable.
140-
const findLinuxBinary = async (packDir, fallback) => {
141-
// Non-app files electron-packager always drops at the top level.
142-
const noise = new Set([
143-
'chrome-sandbox', 'chrome_crashpad_handler', 'chrome_sandbox',
144-
'LICENSE', 'LICENSES.chromium.html', 'version'
145-
]);
146-
try {
147-
const entries = await fsp.readdir(packDir, { withFileTypes: true });
148-
grunt.log.writeln(`Contents of ${packDir}:`);
149-
entries.forEach(e => grunt.log.writeln(` ${e.isDirectory() ? '[dir] ' : ' '}${e.name}`));
150-
151-
// The main binary is the renamed `electron`: a top-level file with no extension
152-
// that isn't one of the known companion files.
153-
const candidates = entries
154-
.filter(e => e.isFile() && !e.name.includes('.') && !noise.has(e.name))
155-
.map(e => e.name);
156-
157-
if (candidates.length === 1) {
158-
grunt.log.ok(`Detected Electron binary: ${candidates[0]}`);
159-
return candidates[0];
160-
}
161-
grunt.log.warn(`Could not uniquely detect the Electron binary (candidates: ${candidates.join(', ') || 'none'}). Falling back to "${fallback}".`);
162-
} catch (err) {
163-
grunt.log.warn(`Could not read ${packDir}: ${err.message}. Falling back to "${fallback}".`);
164-
}
165-
return fallback;
166-
};
167-
168135
grunt.registerTask('create-redhat-installer', 'Create the Redhat .rpm installer', async function () {
169136
const done = this.async();
170137
const installer = require('@dennisrijsdijk/electron-installer-redhat');
171-
const bin = await findLinuxBinary(linuxInstallerConfig.src, linuxInstallerConfig.bin);
172138
installer({
173139
...linuxInstallerConfig,
174-
bin,
175140
options: {
176141
...linuxInstallerConfig.options,
177142
scripts: linuxScriptsRedhat
@@ -187,10 +152,8 @@ module.exports = function (grunt) {
187152
grunt.registerTask('create-debian-installer', 'Create the Debian .deb installer', async function () {
188153
const done = this.async();
189154
const installer = require('electron-installer-debian');
190-
const bin = await findLinuxBinary(linuxInstallerConfig.src, linuxInstallerConfig.bin);
191155
installer({
192156
...linuxInstallerConfig,
193-
bin,
194157
options: {
195158
...linuxInstallerConfig.options,
196159
scripts: linuxScriptsDebian

grunt/copy.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -91,35 +91,6 @@ module.exports = function (grunt) {
9191
grunt.registerTask('copy', function () {
9292
const platform = grunt.config.get('platform');
9393
remFiles(platform);
94-
95-
// Create version file for Linux (required by electron-installer-debian)
96-
if (platform === 'linux') {
97-
const electronPkg = require('../node_modules/electron/package.json');
98-
const packDir = path.join(__dirname, '../dist/pack/Firebot-linux-x64');
99-
const resourcesDir = path.join(packDir, 'resources');
100-
const appDir = path.join(resourcesDir, 'app');
101-
const versionPath = path.join(packDir, 'version');
102-
103-
// Ensure directories exist
104-
try {
105-
fs.mkdirSync(appDir, { recursive: true });
106-
107-
// Copy package.json to resources/app (required by electron-installer-debian)
108-
const packageJsonSrc = path.join(__dirname, '../package.json');
109-
const packageJsonDest = path.join(appDir, 'package.json');
110-
if (!fs.existsSync(packageJsonDest)) {
111-
fs.copyFileSync(packageJsonSrc, packageJsonDest);
112-
grunt.log.ok(`Copied package.json to ${packageJsonDest}`);
113-
}
114-
115-
// Create version file
116-
fs.writeFileSync(versionPath, electronPkg.version, 'utf8');
117-
grunt.log.ok(`Created version file: ${versionPath}`);
118-
} catch (err) {
119-
grunt.log.warn(`Failed to setup Linux build: ${err.message}`);
120-
}
121-
}
122-
12394
grunt.task.run(`xcopy:${platform}`);
12495
});
12596

grunt/fix-macos-symlinks.js

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,19 @@ module.exports = function (grunt) {
6161

6262
if (fixedCount > 0) {
6363
grunt.log.ok(`Fixed ${fixedCount} absolute symlink(s) in ${appPath}`);
64+
65+
// Re-sign the app bundle after symlink modifications
66+
// Symlink changes invalidate the previous code signature
67+
try {
68+
grunt.log.writeln('Re-signing app bundle after symlink fix...');
69+
await execFileAsync('codesign', ['--force', '--deep', '--sign', '-', appPath]);
70+
grunt.log.ok('App bundle re-signed successfully');
71+
} catch (signError) {
72+
grunt.log.warn(`Failed to re-sign app bundle: ${signError.message}`);
73+
}
6474
} else {
6575
grunt.log.ok(`All symlinks are relative in ${appPath}`);
6676
}
67-
68-
// Always clear stale xattrs and ad-hoc re-sign, regardless of whether symlinks
69-
// needed fixing. electron-packager does not sign the app (no osx-sign option), and
70-
// adding resources/app, the asar, and the xcopy'd resources after packaging
71-
// invalidates Electron's bundled ad-hoc signature. Without a valid signature,
72-
// `codesign --verify` fails with "code has no resources but signature indicates they
73-
// must be present" and the app refuses to launch on Apple Silicon. Re-signing ad-hoc
74-
// (`--sign -`) rebuilds a consistent _CodeSignature/CodeResources seal.
75-
try {
76-
grunt.log.writeln('Removing quarantine attributes...');
77-
await execFileAsync('xattr', ['-cr', appPath]);
78-
grunt.log.ok('Quarantine attributes removed');
79-
} catch (xattrError) {
80-
grunt.log.warn(`Failed to remove quarantine: ${xattrError.message}`);
81-
}
82-
83-
try {
84-
grunt.log.writeln('Ad-hoc re-signing app bundle...');
85-
await execFileAsync('codesign', ['--force', '--deep', '--sign', '-', appPath]);
86-
grunt.log.ok('App bundle ad-hoc re-signed successfully');
87-
} catch (signError) {
88-
grunt.log.warn(`Failed to re-sign app bundle: ${signError.message}`);
89-
}
9077
} catch (error) {
9178
grunt.fail.warn(`Failed to fix symlinks: ${error.message}`);
9279
}

grunt/pack.js

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ module.exports = function (grunt) {
3131
let ignoreFlags;
3232
try {
3333
ignoreFlags = formatIgnoreList([
34-
{ dotfiles: true },
35-
{ dotdirs: true },
36-
{ path: 'build/resources' },
37-
{ path: 'dist' },
38-
{ path: 'doc' },
39-
{ path: 'docs' },
40-
{ path: 'grunt' },
41-
{ path: 'profiles' },
42-
{ path: 'src' },
43-
{ path: 'Gruntfile.js', isFile: true },
44-
{ path: 'package.lock', isFile: true },
45-
{ path: 'README.md', isFile: true },
46-
{ path: 'secrets.gpg', isFile: true },
47-
{ path: 'tsconfig.json', isFile: true }
34+
{dotfiles: true},
35+
{dotdirs: true},
36+
{path: 'build/resources'},
37+
{path: 'dist'},
38+
{path: 'doc'},
39+
{path: 'docs'},
40+
{path: 'grunt'},
41+
{path: 'profiles'},
42+
{path: 'src'},
43+
{path: 'Gruntfile.js', isFile: true},
44+
{path: 'package.lock', isFile: true},
45+
{path: 'README.md', isFile: true},
46+
{path: 'secrets.gpg', isFile: true},
47+
{path: 'tsconfig.json', isFile: true}
4848
]);
4949
} catch (err) {
5050
grunt.fail.fatal(err);
@@ -66,15 +66,6 @@ module.exports = function (grunt) {
6666
...ignoreFlags
6767
].join(' ');
6868

69-
// Keep --asar for Linux (matches upstream and the win/mac targets). electron-installer-debian
70-
// DOES read metadata from resources/app.asar (electron-installer-common's readMetadata), so the
71-
// earlier "doesn't handle asar" assumption was wrong. Packing into a single app.asar instead of
72-
// copying ~18k unpacked files avoids the copy stalling on the CI runner. Linux executable names
73-
// can't contain spaces, so use "firebot" instead of "Firebot v5".
74-
const linuxFlags = flags
75-
.replace('--executable-name="Firebot v5"', '--executable-name="firebot"')
76-
.trim();
77-
7869
const appPackageJson = grunt.file.readJSON('./package.json');
7970

8071
// electron-packager doesn't like prerelease tags with dots in them for the Windows target
@@ -91,7 +82,7 @@ module.exports = function (grunt) {
9182
command: `npx --no-install @electron/packager . Firebot --platform=darwin ${flags.replace('--arch=x64', '')} --arch=x64 --arch=arm64 --extend-info="extra.plist" --extra-resource="./src/resources/firebot-setup-file-icon.icns"`
9283
},
9384
packlinux: {
94-
command: `npx --no-install @electron/packager . Firebot --platform=linux ${linuxFlags}`
85+
command: `npx --no-install @electron/packager . Firebot --platform=linux ${flags}`
9586
}
9687
}
9788
});

0 commit comments

Comments
 (0)