@@ -123,6 +123,48 @@ jobs:
123123 parameters : |
124124 version: ${{ toJSON(github.ref_name) }}
125125
126+ - name : Rebuild blockmap and latest.yml from signed installer
127+ shell : bash
128+ run : |
129+ set -euo pipefail
130+ SIGNED_EXE=$(echo signed-windows/*.exe)
131+ EXE_BASENAME=$(basename "$SIGNED_EXE")
132+ VERSION=$(node -p "require('./package.json').version")
133+ OUT_DIR=dist-win32
134+ mkdir -p "$OUT_DIR"
135+
136+ APP_BUILDER=$(node -p "require('app-builder-bin').path")
137+ "$APP_BUILDER" blockmap --input "$SIGNED_EXE" --output "$OUT_DIR/${EXE_BASENAME}.blockmap"
138+
139+ EXE="$SIGNED_EXE" BLOCKMAP="$OUT_DIR/${EXE_BASENAME}.blockmap" VERSION="$VERSION" OUT_DIR="$OUT_DIR" node - <<'EOF'
140+ const fs = require('fs');
141+ const crypto = require('crypto');
142+ const path = require('path');
143+
144+ const exe = process.env.EXE;
145+ const blockmap = process.env.BLOCKMAP;
146+ const version = process.env.VERSION;
147+ const outDir = process.env.OUT_DIR;
148+
149+ const exeStats = fs.statSync(exe);
150+ const blockmapStats = fs.statSync(blockmap);
151+ const sha512 = crypto.createHash('sha512').update(fs.readFileSync(exe)).digest('base64');
152+
153+ const lines = [
154+ `version: ${version}`,
155+ `files:`,
156+ ` - url: ${path.basename(exe)}`,
157+ ` sha512: ${sha512}`,
158+ ` size: ${exeStats.size}`,
159+ ` blockMapSize: ${blockmapStats.size}`,
160+ `path: ${path.basename(exe)}`,
161+ `sha512: ${sha512}`,
162+ `releaseDate: "${new Date().toISOString()}"`
163+ ];
164+
165+ fs.writeFileSync(path.join(outDir, 'latest.yml'), lines.join('\n'));
166+ EOF
167+
126168# # Replace the unsigned exe with the signed exe
127169# - name: Replace with signed exe
128170# run: |
@@ -164,6 +206,7 @@ jobs:
164206 # --notes "Pinokio version $PACKAGE_VERSION."
165207
166208 mac :
209+ if : false
167210 needs : " create-release"
168211 runs-on : macos-latest
169212 permissions :
@@ -212,7 +255,7 @@ jobs:
212255 run : cat dist-darwin/**/notarization-error.log || echo "No notarization-error.log found"
213256
214257 linux :
215- # if: false
258+ if : false
216259 needs : " create-release"
217260 runs-on : ubuntu-latest
218261 permissions :
0 commit comments