Updated Luncher build script so it uses windows manifests and icon
This commit is contained in:
parent
c7834e5949
commit
8875f555c5
1 changed files with 67 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
||||||
name: Build Luncher for Windows/AMD64/Nightly
|
name: Build Luncher for Windows/AMD64/Nightly
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch: {}
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *"
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
|
@ -9,24 +10,63 @@ jobs:
|
||||||
runs-on: win-10
|
runs-on: win-10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Publisher repo
|
- name: Check rsrc tool
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
rsrc --version || echo "rsrc tool not available"
|
||||||
|
|
||||||
|
- name: Check windres availability
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
windres --version || echo "windres not available, please install mingw"
|
||||||
|
|
||||||
|
- name: Check ImageMagick version
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
magick -version
|
||||||
|
|
||||||
|
- name: Clone Publisher repo and Generate Manifest Files
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git clone https://weforge.xyz/Spitfire/Publisher.git
|
git clone https://weforge.xyz/Spitfire/Publisher.git
|
||||||
|
cd Publisher
|
||||||
|
# Run win_manifest_gen.go to generate manifest files.
|
||||||
|
go run win_manifest_gen.go \
|
||||||
|
--name "Spitfire Luncher" \
|
||||||
|
--company "Spitfire Browser" \
|
||||||
|
--description "Official Luncher for Spitfire Browser" \
|
||||||
|
--official "https://spitfirebrowser.xyz" \
|
||||||
|
--dev "https://weforge.xyz" \
|
||||||
|
--requireAdmin=false
|
||||||
|
# Copy generated files (app.manifest and app.rc) to the workspace root.
|
||||||
|
cp app.manifest ../
|
||||||
|
cp app.rc ../
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Clone and Build Spitfire Luncher
|
- name: Clone Luncher, Convert Icon, and Build Spitfire Luncher
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
git clone https://weforge.xyz/Spitfire/Luncher.git
|
git clone https://weforge.xyz/Spitfire/Luncher.git
|
||||||
cd Luncher
|
cd Luncher
|
||||||
|
# Copy the generated manifest files from the workspace root.
|
||||||
|
cp ../app.manifest .
|
||||||
|
cp ../app.rc .
|
||||||
|
# Download the icon PNG (530x530) from the dynamic URL.
|
||||||
|
curl -fL "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.png?raw=true" -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
|
||||||
|
# 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 Luncher executable; 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-luncher.exe
|
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o spitfire-luncher.exe
|
||||||
|
# Move the built executable one level up for packaging.
|
||||||
mv spitfire-luncher.exe ..
|
mv spitfire-luncher.exe ..
|
||||||
|
cd ..
|
||||||
- name: Download logo image for luncher (with temporary link)
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p spm
|
|
||||||
curl -L -o spm/logo.png "https://weforge.xyz/Spitfire/Branding/raw/commit/f1a70addd443f91b98bea8ff9cc924af1ac67600/logo6-only-plane.png"
|
|
||||||
|
|
||||||
- name: Setup SSH Key for SourceForge
|
- name: Setup SSH Key for SourceForge
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -41,38 +81,37 @@ jobs:
|
||||||
env:
|
env:
|
||||||
SF_USER: ${{ secrets.SF_USER }}
|
SF_USER: ${{ secrets.SF_USER }}
|
||||||
run: |
|
run: |
|
||||||
scp -i sf_key -o IdentitiesOnly=yes \
|
scp -i sf_key -o IdentitiesOnly=yes "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX" APPINDEX || true
|
||||||
"$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX" \
|
|
||||||
APPINDEX || true
|
- name: Download logo image for luncher (with temporary link)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p spm
|
||||||
|
curl -L -o spm/logo.png "https://weforge.xyz/Spitfire/Branding/raw/commit/f1a70addd443f91b98bea8ff9cc924af1ac67600/logo6-only-plane.png"
|
||||||
|
|
||||||
- name: Compress artifact
|
- name: Compress artifact
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
tar -czf spitfire-luncher-amd64-nightly-windows.tar.gz spitfire-luncher.exe spm/luncher.png
|
tar -czf spitfire-luncher-amd64-nightly-windows.tar.gz spitfire-luncher.exe spm/logo.png
|
||||||
ls -l
|
ls -l
|
||||||
|
|
||||||
- name: Prepare installer folder structure and move artifact
|
- name: Prepare luncher folder structure and move artifact
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Compute current date (e.g. 2025.02.11)
|
|
||||||
DATE=$(date +'%Y.%m.%d')
|
DATE=$(date +'%Y.%m.%d')
|
||||||
# Create a separate packaging folder "upload" to avoid conflicts with the cloned repo folder.
|
|
||||||
mkdir -p upload/luncher/amd64/nightly/$DATE
|
mkdir -p upload/luncher/amd64/nightly/$DATE
|
||||||
mv spitfire-luncher-amd64-nightly-windows.tar.gz upload/luncher/amd64/nightly/$DATE/
|
mv spitfire-luncher-amd64-nightly-windows.tar.gz upload/luncher/amd64/nightly/$DATE/
|
||||||
# Save the date for later steps.
|
|
||||||
echo "$DATE" > date.txt
|
echo "$DATE" > date.txt
|
||||||
|
|
||||||
- name: Upload installer artifact to SourceForge
|
- name: Upload luncher artifact to SourceForge
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
SF_USER: ${{ secrets.SF_USER }}
|
SF_USER: ${{ secrets.SF_USER }}
|
||||||
run: |
|
run: |
|
||||||
# Read the date from file (if needed later)
|
|
||||||
DATE=$(cat date.txt)
|
DATE=$(cat date.txt)
|
||||||
# Upload the entire packaging folder recursively.
|
|
||||||
scp -r -i sf_key -o IdentitiesOnly=yes upload/luncher "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/"
|
scp -r -i sf_key -o IdentitiesOnly=yes upload/luncher "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/"
|
||||||
|
|
||||||
- name: Update APPINDEX
|
- name: Update APPINDEX for Luncher
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
DATE=$(cat date.txt)
|
DATE=$(cat date.txt)
|
||||||
|
@ -99,10 +138,10 @@ jobs:
|
||||||
--uncompressedFile "spitfire-luncher.exe"
|
--uncompressedFile "spitfire-luncher.exe"
|
||||||
cp APPINDEX ../
|
cp APPINDEX ../
|
||||||
|
|
||||||
- name: Upload updated APPINDEX
|
- name: Upload updated APPINDEX for Luncher
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
SF_USER: ${{ secrets.SF_USER }}
|
SF_SSH_USER: ${{ secrets.SF_USER }}
|
||||||
run: |
|
run: |
|
||||||
scp -i sf_key -o IdentitiesOnly=yes APPINDEX "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX"
|
scp -i sf_key -o IdentitiesOnly=yes APPINDEX "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue