Skip to content

Commit 8cbb5ba

Browse files
fix: shimmer windows build (#8696)
* fix: sha calculation and bump version to shimmer alpha 1 * fix: sha calculation and bump version to shimmer alpha 2 * fix: sha calculation and bump version to shimmer alpha 3 * fix: bump version to shimmer 2.1.1-alpha 1 * fix: bump version to shimmer 2.1.1-alpha 2 * fix: remove sha calcualtion * fix: bump version to shimmer 2.1.1-alpha 3 * bump to alpha-1 * fix: bump version to shimmer 2.1.1-alpha 2 * fix: bump version to shimmer 2.1.1-alpha 4 * fix: bump version to shimmer 2.1.1-alpha 5 * chore: bump version to 2.2.1 --------- Co-authored-by: Begoña Alvarez <[email protected]>
1 parent 3afc201 commit 8cbb5ba

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

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

+47
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,53 @@ jobs:
193193
echo "✅ Signing complete"
194194
working-directory: packages/desktop
195195
if: matrix.os == 'windows-2019'
196+
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/shimmer-alpha.yml"
205+
elif [[ "${{ env.STAGE }}" == "beta" ]]; then
206+
LATEST_YML="packages/desktop/out/shimmer-beta.yml"
207+
else
208+
LATEST_YML="packages/desktop/out/shimmer.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'
196243

197244
- name: Build Electron app (Linux)
198245
run: yarn compile:${STAGE}:linux

packages/desktop/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "desktop",
33
"productName": "Firefly Shimmer",
4-
"version": "2.2.0",
4+
"version": "2.2.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)