From 43b1fdd76e00e350ed7c4f35ebadb5d1623b800e Mon Sep 17 00:00:00 2001 From: partisan Date: Mon, 17 Feb 2025 20:14:17 +0000 Subject: [PATCH] Added manifest and icon to spitfire-installer.exe build --- .../Installer_Windows-AMD64-Nightly.yaml | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/Installer_Windows-AMD64-Nightly.yaml b/.forgejo/workflows/Installer_Windows-AMD64-Nightly.yaml index 84493e9..0d3d568 100644 --- a/.forgejo/workflows/Installer_Windows-AMD64-Nightly.yaml +++ b/.forgejo/workflows/Installer_Windows-AMD64-Nightly.yaml @@ -9,17 +9,85 @@ jobs: runs-on: win-10 steps: + - name: Install rsrc tool + shell: bash + run: | + go install github.com/akavel/rsrc@latest + - name: Clone Publisher repo shell: bash run: | git clone https://weforge.xyz/Spitfire/Publisher.git - - name: Clone and Build Spitfire Installer + - name: Clone, generate manifest, convert icon, and Build Spitfire Installer shell: bash run: | + set -e git clone https://weforge.xyz/Spitfire/Installer.git cd Installer + + # Compute current date (e.g. 2025.02.11) + DATE=$(date +'%Y.%m.%d') + + # Download the icon PNG (530x530) from the dynamic URL + curl -L "https://weforge.xyz/Spitfire/Branding/src/branch/main/active/browser/icon.png" -o icon.png + + # Convert the PNG to a Windows ICO file with multiple sizes using ImageMagick. + # This command auto-resizes to common icon sizes: 256, 128, 64, 48, 32, and 16. + magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico + + # Create dynamic app.manifest with DATE as version (appending .0 to meet version format) + cat < app.manifest + + + + + + + + + + + + + true/PM + + + +EOF + + # Create version info JSON with dynamic version and website URLs in Comments + cat < versioninfo.json + { + "Version": { + "Major": 0, + "Minor": 0, + "Patch": 0, + "Build": 0 + }, + "CompanyName": "Spitfire Browser", + "FileDescription": "Official Installer for Spitfire Browser", + "FileVersion": "${DATE}.0", + "InternalName": "spitfire-installer", + "LegalCopyright": "Copyright © Spitfire Browser", + "OriginalFilename": "spitfire-installer.exe", + "ProductName": "Spitfire Browser", + "ProductVersion": "${DATE}.0", + "Comments": "Official website: https://spitfirebrowser.xyz; Source/Dev website: https://weforge.xyz" + } +EOF + + # Generate the resource file embedding manifest, version info, and the icon. + rsrc -manifest app.manifest -json versioninfo.json -ico icon.ico -o rsrc.syso + + # Build the installer; rsrc.syso is automatically linked by the Go compiler. CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o spitfire-installer.exe + + # Move the built executable one level up for further packaging. mv spitfire-installer.exe .. - name: Setup SSH Key for SourceForge