Skip to content

Commit f37dc15

Browse files
re-compute hash for latest.yml for windows
1 parent da4f680 commit f37dc15

2 files changed

Lines changed: 46 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Pinokio",
33
"private": true,
4-
"version": "3.341.0",
4+
"version": "3.342.0",
55
"homepage": "https://pinokio.co",
66
"description": "pinokio",
77
"main": "main.js",
@@ -144,7 +144,7 @@
144144
"electron-store": "^8.1.0",
145145
"electron-updater": "^6.6.2",
146146
"electron-window-state": "^5.0.3",
147-
"pinokiod": "^3.341.0"
147+
"pinokiod": "^3.342.0"
148148
},
149149
"devDependencies": {
150150
"@electron/rebuild": "3.2.10",

0 commit comments

Comments
 (0)