Fixed icon and manifest for Installer
This commit is contained in:
parent
9b05914fc3
commit
c7834e5949
1 changed files with 37 additions and 31 deletions
|
@ -9,28 +9,27 @@ jobs:
|
|||
runs-on: win-10
|
||||
|
||||
steps:
|
||||
- name: Install rsrc tool
|
||||
- name: Check rsrc tool
|
||||
shell: bash
|
||||
run: |
|
||||
go install github.com/akavel/rsrc@latest
|
||||
rsrc --version || echo "rsrc tool not available"
|
||||
|
||||
- name: Install ImageMagick (if not already installed)
|
||||
- name: Check windres availability
|
||||
shell: bash
|
||||
run: |
|
||||
windres --version || echo "windres not available, please install mingw"
|
||||
|
||||
- name: Check ImageMagick version
|
||||
shell: powershell
|
||||
run: |
|
||||
choco install imagemagick -y --no-progress
|
||||
magick -version
|
||||
|
||||
- name: Clone Publisher repo
|
||||
- name: Clone Publisher repo and Generate Manifest Files
|
||||
shell: bash
|
||||
run: |
|
||||
git clone https://weforge.xyz/Spitfire/Publisher.git
|
||||
|
||||
- name: Clone Manifest Generator and Generate Manifest Files
|
||||
shell: bash
|
||||
run: |
|
||||
git clone https://weforge.xyz/partisan/upload-test.git manifest-gen
|
||||
cd manifest-gen
|
||||
# Run the manifest generator with desired flags.
|
||||
# Adjust the flag values as needed.
|
||||
cd Publisher
|
||||
# Run win_manifest_gen.go from the Publisher repo to generate manifest files.
|
||||
go run win_manifest_gen.go \
|
||||
--name "Spitfire Installer" \
|
||||
--company "Spitfire Browser" \
|
||||
|
@ -38,9 +37,10 @@ jobs:
|
|||
--official "https://spitfirebrowser.xyz" \
|
||||
--dev "https://weforge.xyz" \
|
||||
--requireAdmin=false
|
||||
# Copy generated files to the workspace root.
|
||||
# Copy generated files (app.manifest and app.rc) to the workspace root.
|
||||
cp app.manifest ../
|
||||
cp versioninfo.json ../
|
||||
cp app.rc ../
|
||||
cd ..
|
||||
|
||||
- name: Clone Installer, Convert Icon, and Build Spitfire Installer
|
||||
shell: bash
|
||||
|
@ -48,20 +48,26 @@ jobs:
|
|||
set -e
|
||||
git clone https://weforge.xyz/Spitfire/Installer.git
|
||||
cd Installer
|
||||
# Copy the generated manifest files from the parent directory.
|
||||
# Copy the generated manifest files from the workspace root.
|
||||
cp ../app.manifest .
|
||||
cp ../versioninfo.json .
|
||||
cp ../app.rc .
|
||||
# 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
|
||||
curl -fL "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.png" -o icon.png
|
||||
ls -l icon.png
|
||||
head -n 10 icon.png || true
|
||||
# Convert the PNG to a Windows ICO file with multiple sizes using ImageMagick.
|
||||
magick icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
|
||||
# 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
|
||||
# Prepend an ICON directive to app.rc so the icon is embedded.
|
||||
echo '1 ICON "icon.ico"' | cat - app.rc > tmp.rc && mv tmp.rc app.rc
|
||||
# Compile the resource script into a .syso file using windres.
|
||||
windres app.rc -O coff -o resource.syso
|
||||
# Build the installer; resource.syso is automatically linked.
|
||||
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 packaging.
|
||||
mv spitfire-installer.exe ..
|
||||
|
||||
cd ..
|
||||
|
||||
- name: Setup SSH Key for SourceForge
|
||||
shell: bash
|
||||
env:
|
||||
|
@ -69,20 +75,20 @@ jobs:
|
|||
run: |
|
||||
echo "$SF_SSH_KEY" | sed 's/\\n/\n/g' | tr -d '\r' > sf_key
|
||||
chmod 600 sf_key
|
||||
|
||||
|
||||
- name: Download existing APPINDEX
|
||||
shell: bash
|
||||
env:
|
||||
SF_USER: ${{ secrets.SF_USER }}
|
||||
run: |
|
||||
scp -i sf_key -o IdentitiesOnly=yes "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX" APPINDEX || true
|
||||
|
||||
|
||||
- name: Compress artifact
|
||||
shell: bash
|
||||
run: |
|
||||
tar -czf spitfire-installer-amd64-nightly-windows.tar.gz spitfire-installer.exe
|
||||
ls -l
|
||||
|
||||
|
||||
- name: Prepare installer folder structure and move artifact
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -90,7 +96,7 @@ jobs:
|
|||
mkdir -p upload/installer/amd64/nightly/$DATE
|
||||
mv spitfire-installer-amd64-nightly-windows.tar.gz upload/installer/amd64/nightly/$DATE/
|
||||
echo "$DATE" > date.txt
|
||||
|
||||
|
||||
- name: Upload installer artifact to SourceForge
|
||||
shell: bash
|
||||
env:
|
||||
|
@ -98,7 +104,7 @@ jobs:
|
|||
run: |
|
||||
DATE=$(cat date.txt)
|
||||
scp -r -i sf_key -o IdentitiesOnly=yes upload/installer "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/"
|
||||
|
||||
|
||||
- name: Update APPINDEX
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -125,16 +131,16 @@ jobs:
|
|||
--compressedFile "spitfire-installer-amd64-nightly-windows.tar.gz" \
|
||||
--uncompressedFile "spitfire-installer.exe"
|
||||
cp APPINDEX ../
|
||||
|
||||
|
||||
- name: Upload updated APPINDEX
|
||||
shell: bash
|
||||
env:
|
||||
SF_USER: ${{ secrets.SF_USER }}
|
||||
run: |
|
||||
scp -i sf_key -o IdentitiesOnly=yes APPINDEX "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX"
|
||||
|
||||
|
||||
- name: Cleanup SSH Key
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
rm -f sf_key
|
||||
rm -f sf_key
|
Loading…
Add table
Add a link
Reference in a new issue