Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build-and-release-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,53 @@ jobs:
working-directory: packages/desktop
if: matrix.os == 'windows-2019'

- name: Update latest.yml with signed file details
shell: bash
run: |
FILE="packages/desktop/out/firefly-${{ env.NETWORK_CODE }}-desktop-${{ env.VERSION }}.exe"

# Dynamically determine the correct latest.yml file name
if [[ "${{ env.STAGE }}" == "alpha" ]]; then
LATEST_YML="packages/desktop/out/latest-alpha.yml"
elif [[ "${{ env.STAGE }}" == "beta" ]]; then
LATEST_YML="packages/desktop/out/latest-beta.yml"
else
LATEST_YML="packages/desktop/out/latest.yml"
fi

# Get the file size in bytes
SIZE=$(stat -c%s "$FILE")

# Calculate Base64-encoded SHA-512 hash using CertUtil
HASH=$(certutil -hashfile "$FILE" SHA512 | tail -n +2 | head -n -1 | tr -d '\r\n' | xxd -r -p | base64)
# Remove any newlines from the HASH
HASH=$(echo "$HASH" | tr -d '\n')

# Log the calculated hash and file size
echo "Calculated SHA-512 hash (Base64): $HASH"
echo "File size (bytes): $SIZE"

# Install Chocolatey and yq (for Windows)
if ! command -v yq &> /dev/null; then
echo "yq not found. Installing yq..."
powershell -Command "
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'));
choco install yq -y
"
else
echo "yq is already installed."
fi

# Update the YAML file using yq
yq e ".files[0].sha512 = \"$HASH\"" -i "$LATEST_YML"
yq e ".files[0].size = $SIZE" -i "$LATEST_YML"
yq e ".sha512 = \"$HASH\"" -i "$LATEST_YML"
yq e -i ".files[0].sha512 |= . | .sha512 |= ." "$LATEST_YML"
echo "Updated $LATEST_YML with size=$SIZE and sha512=$HASH"
if: matrix.os == 'windows-2019'

- name: Build Electron app (Linux)
run: yarn compile:${STAGE}:linux
working-directory: packages/desktop
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "desktop",
"productName": "Firefly IOTA",
"version": "2.1.0",
"version": "2.1.1",
"description": "Official wallet application of Shimmer",
"main": "public/build/main.js",
"repository": "[email protected]:iotaledger/firefly.git",
Expand Down
Loading