Skip to content

Commit

Permalink
Merge pull request #339 from ooni/release-3.9.7
Browse files Browse the repository at this point in the history
Release v3.9.7
  • Loading branch information
majakomel authored Aug 6, 2024
2 parents 6f57893 + 3c3d949 commit 45acd5f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "OONI Probe Desktop app",
"author": "Open Observatory of Network Interference (OONI) <contact@openobservatory.org>",
"productName": "OONI Probe",
"version": "3.9.6",
"version": "3.9.7",
"probeVersion": "3.22.0",
"main": "main/index.js",
"license": "BSD-3-Clause",
Expand All @@ -18,7 +18,8 @@
"download": "yarn run download:tor && yarn run download:probe-cli",
"download:tor": "node scripts/download-tor.js",
"download:probe-cli": "node scripts/download-probe-cli.js",
"pack": "yarn run build:clean && electron-builder --win --mac --linux",
"pack": "yarn run build:clean && electron-builder --mac --linux -p never && electron-builder --dir --win -p never",
"packWin": "electron-builder --prepackaged ./dist/win-arm64-unpacked --win",
"pack:win": "yarn run build:clean && electron-builder --win --x64",
"pack:mac": "yarn run build:clean && electron-builder --mac",
"pack:linux": "yarn run build:clean && electron-builder --linux",
Expand Down
14 changes: 1 addition & 13 deletions scripts/download-probe-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,7 @@ const download = () => {
}
osarch = osarch.replace('-', '_')
ensureDirSync(`${dstDir}/${osarch}`)
if (osarch === 'windows_amd64') {
execSync(
`cp ${dstDir}/${versionedFilename} ${dstDir}/${osarch}/ooniprobe${extension}-unsigned`
)
execSync(
`osslsigncode sign -pkcs12 ${process.env.WIN_CSC_LINK} -pass ${process.env.WIN_CSC_KEY_PASSWORD} -n "OONI Probe CLI" -i https://ooni.org/ -in ${dstDir}/${osarch}/ooniprobe${extension}-unsigned -out ${dstDir}/${osarch}/ooniprobe${extension}`
)
execSync(`rm -rf ${dstDir}/${osarch}/ooniprobe${extension}-unsigned`)
} else {
execSync(
`cp ${dstDir}/${versionedFilename} ${dstDir}/${osarch}/ooniprobe${extension}`
)
}
execSync(`cp ${dstDir}/${versionedFilename} ${dstDir}/${osarch}/ooniprobe${extension}`)
execSync(`chmod +x ${dstDir}/${osarch}/ooniprobe${extension}`)
}
}
Expand Down
34 changes: 34 additions & 0 deletions scripts/hashFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// copied from https://stackoverflow.com/a/60208623
const path = require('path')
const fs = require('fs')
const crypto = require('crypto')

const YOUR_FILE_PATH = './dist/OONI Probe Setup 3.9.7-rc.1.exe'

function hashFile(file, algorithm = 'sha512', encoding = 'base64', options) {
return new Promise((resolve, reject) => {
const hash = crypto.createHash(algorithm)
hash.on('error', reject).setEncoding(encoding)
fs.createReadStream(
file,
Object.assign({}, options, {
highWaterMark: 1024 * 1024,
/* better to use more memory but hash faster */
})
)
.on('error', reject)
.on('end', () => {
hash.end()
console.log('hash done')
console.log(hash.read())
resolve(hash.read())
})
.pipe(hash, {
end: false,
})
})
}

const installerPath = path.resolve(__dirname, YOUR_FILE_PATH)

hashFile(installerPath)

0 comments on commit 45acd5f

Please sign in to comment.