Skip to content

Commit 0b508e9

Browse files
Merge branch 'release/desktop-iota-2.1.0' of github.com:iotaledger/firefly into release/desktop-iota-2.1.0
2 parents 14c35ed + 6ee3c22 commit 0b508e9

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/build-and-release-desktop.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,53 @@ jobs:
194194
working-directory: packages/desktop
195195
if: matrix.os == 'windows-2019'
196196

197+
- name: Update latest.yml with signed file details
198+
shell: bash
199+
run: |
200+
FILE="packages/desktop/out/firefly-${{ env.NETWORK_CODE }}-desktop-${{ env.VERSION }}.exe"
201+
202+
# Dynamically determine the correct latest.yml file name
203+
if [[ "${{ env.STAGE }}" == "alpha" ]]; then
204+
LATEST_YML="packages/desktop/out/latest-alpha.yml"
205+
elif [[ "${{ env.STAGE }}" == "beta" ]]; then
206+
LATEST_YML="packages/desktop/out/latest-beta.yml"
207+
else
208+
LATEST_YML="packages/desktop/out/latest.yml"
209+
fi
210+
211+
# Get the file size in bytes
212+
SIZE=$(stat -c%s "$FILE")
213+
214+
# Calculate Base64-encoded SHA-512 hash using CertUtil
215+
HASH=$(certutil -hashfile "$FILE" SHA512 | tail -n +2 | head -n -1 | tr -d '\r\n' | xxd -r -p | base64)
216+
# Remove any newlines from the HASH
217+
HASH=$(echo "$HASH" | tr -d '\n')
218+
219+
# Log the calculated hash and file size
220+
echo "Calculated SHA-512 hash (Base64): $HASH"
221+
echo "File size (bytes): $SIZE"
222+
223+
# Install Chocolatey and yq (for Windows)
224+
if ! command -v yq &> /dev/null; then
225+
echo "yq not found. Installing yq..."
226+
powershell -Command "
227+
Set-ExecutionPolicy Bypass -Scope Process -Force;
228+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
229+
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'));
230+
choco install yq -y
231+
"
232+
else
233+
echo "yq is already installed."
234+
fi
235+
236+
# Update the YAML file using yq
237+
yq e ".files[0].sha512 = \"$HASH\"" -i "$LATEST_YML"
238+
yq e ".files[0].size = $SIZE" -i "$LATEST_YML"
239+
yq e ".sha512 = \"$HASH\"" -i "$LATEST_YML"
240+
yq e -i ".files[0].sha512 |= . | .sha512 |= ." "$LATEST_YML"
241+
echo "Updated $LATEST_YML with size=$SIZE and sha512=$HASH"
242+
if: matrix.os == 'windows-2019'
243+
197244
- name: Build Electron app (Linux)
198245
run: yarn compile:${STAGE}:linux
199246
working-directory: packages/desktop

packages/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "desktop",
33
"productName": "Firefly IOTA",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"description": "Official wallet application of Shimmer",
66
"main": "public/build/main.js",
77
"repository": "[email protected]:iotaledger/firefly.git",

0 commit comments

Comments
 (0)