Update .forgejo/workflows/Luncher_Windows-AMD64-Nightly.yaml
This commit is contained in:
parent
3a5f009e3a
commit
12e3570c8c
1 changed files with 51 additions and 75 deletions
|
@ -6,113 +6,95 @@ on:
|
||||||
- cron: "0 0 * * *"
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build:
|
||||||
runs-on: win-10
|
runs-on: alpine-1.20
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check rsrc tool
|
- name: Setup Environment
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
rsrc --version || echo "rsrc tool not available"
|
export LOCAL_BIN="$HOME/.local/bin"
|
||||||
|
mkdir -p "$LOCAL_BIN"
|
||||||
|
export PATH="$PATH:$LOCAL_BIN:$HOME/go/bin"
|
||||||
|
|
||||||
- name: Check windres availability
|
- name: Verify Tools
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
windres --version || echo "windres not available, please install mingw"
|
command -v go || { echo "::error::Go not found"; exit 1; }
|
||||||
|
command -v git || { echo "::error::Git not found"; exit 1; }
|
||||||
|
command -v curl || { echo "::error::Curl not found"; exit 1; }
|
||||||
|
command -v x86_64-w64-mingw32-windres || { echo "::error::Mingw-w64 not found"; exit 1; }
|
||||||
|
command -v magick || { echo "::error::ImageMagick not found"; exit 1; }
|
||||||
|
[ -f "$HOME/go/bin/rsrc" ] || { echo "::error::rsrc not found"; exit 1; }
|
||||||
|
|
||||||
- name: Check ImageMagick version
|
- name: Clone Repositories
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
magick -version
|
|
||||||
|
|
||||||
- name: Clone Publisher repo and Generate Manifest Files
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
git clone https://weforge.xyz/Spitfire/Publisher.git
|
git clone https://weforge.xyz/Spitfire/Publisher.git
|
||||||
|
git clone https://weforge.xyz/Spitfire/Luncher.git
|
||||||
|
|
||||||
|
- name: Generate Manifest Files
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
cd Publisher
|
cd Publisher
|
||||||
# Run win_manifest_gen.go to generate manifest files.
|
# Run win_manifest_gen.go from the Publisher repo to generate manifest files.
|
||||||
go run win_manifest_gen.go \
|
go run win_manifest_gen.go \
|
||||||
--name "Spitfire Luncher" \
|
--name "Spitfire Luncher" \
|
||||||
--company "Spitfire Browser" \
|
--company "Spitfire Browser" \
|
||||||
--description "Official Luncher for Spitfire Browser" \
|
--description "Official Luncher for Spitfire Browser" \
|
||||||
--official "https://spitfirebrowser.xyz" \
|
--official "https://spitfirebrowser.xyz" \
|
||||||
--dev "https://weforge.xyz" \
|
--dev "https://weforge.xyz" \
|
||||||
--requireAdmin=false
|
--requireAdmin=true
|
||||||
# Copy generated files (app.manifest and app.rc) to the workspace root.
|
# Copy generated files (app.manifest and app.rc) to the workspace root.
|
||||||
cp app.manifest ../
|
cp app.manifest ../Luncher/
|
||||||
cp app.rc ../
|
cp app.rc ../Luncher/
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Clone Luncher, Convert Icon, and Build Spitfire Luncher
|
- name: Build Windows Luncher
|
||||||
shell: bash
|
working-directory: ./Luncher
|
||||||
run: |
|
run: |
|
||||||
set -e
|
curl -fL "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.png" -o icon.png
|
||||||
git clone https://weforge.xyz/Spitfire/Luncher.git
|
|
||||||
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
|
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"' >> app.rc
|
||||||
echo '1 ICON "icon.ico"' | cat - app.rc > tmp.rc && mv tmp.rc app.rc
|
x86_64-w64-mingw32-windres app.rc -O coff -o app.syso
|
||||||
# Compile the resource script into a .syso file using windres.
|
$HOME/go/bin/rsrc -manifest app.manifest -o rsrc.syso
|
||||||
windres app.rc -O coff -o resource.syso
|
|
||||||
# Build the Luncher executable; resource.syso is automatically linked.
|
# Verify syso files exist
|
||||||
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o spitfire-luncher.exe
|
ls -la *.syso
|
||||||
# Move the built executable one level up for packaging.
|
|
||||||
mv spitfire-luncher.exe ..
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
- name: Setup SSH Key for SourceForge
|
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 \
|
||||||
shell: bash
|
go build -ldflags "-s -w -H=windowsgui" -o spitfire-luncher.exe
|
||||||
|
|
||||||
|
# Verify executable metadata
|
||||||
|
exiftool spitfire-luncher.exe
|
||||||
|
|
||||||
|
upx --best spitfire-luncher.exe
|
||||||
|
|
||||||
|
- name: Setup SSH Key
|
||||||
env:
|
env:
|
||||||
SF_SSH_KEY: ${{ secrets.SF_SSH_KEY }}
|
SF_SSH_KEY: ${{ secrets.SF_SSH_KEY }}
|
||||||
run: |
|
run: |
|
||||||
echo "$SF_SSH_KEY" | sed 's/\\n/\n/g' | tr -d '\r' > sf_key
|
echo "${SF_SSH_KEY}" > sf_key
|
||||||
chmod 600 sf_key
|
chmod 600 sf_key
|
||||||
|
|
||||||
- name: Download existing APPINDEX
|
- name: Download APPINDEX
|
||||||
shell: bash
|
|
||||||
env:
|
env:
|
||||||
SF_USER: ${{ secrets.SF_USER }}
|
SF_USER: ${{ secrets.SF_USER }}
|
||||||
run: |
|
run: |
|
||||||
scp -i sf_key -o IdentitiesOnly=yes "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX" APPINDEX || true
|
scp -i sf_key -vvv -o IdentitiesOnly=yes "$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: Prepare Artifact
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
tar -czf spitfire-luncher-amd64-nightly-windows.tar.gz spitfire-luncher.exe spm/logo.png
|
|
||||||
ls -l
|
|
||||||
|
|
||||||
- name: Prepare luncher folder structure and move artifact
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
DATE=$(date +'%Y.%m.%d')
|
DATE=$(date +'%Y.%m.%d')
|
||||||
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/
|
tar -czf upload/luncher/amd64/nightly/$DATE/spitfire-luncher-amd64-nightly-windows.tar.gz -C Luncher spitfire-luncher.exe
|
||||||
echo "$DATE" > date.txt
|
echo "$DATE" > date.txt
|
||||||
|
|
||||||
- name: Upload luncher artifact to SourceForge
|
- name: Upload Artifact
|
||||||
shell: bash
|
|
||||||
env:
|
env:
|
||||||
SF_USER: ${{ secrets.SF_USER }}
|
SF_USER: ${{ secrets.SF_USER }}
|
||||||
run: |
|
run: |
|
||||||
DATE=$(cat date.txt)
|
DATE=$(cat date.txt)
|
||||||
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 for Luncher
|
- name: Update APPINDEX
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
DATE=$(cat date.txt)
|
DATE=$(cat date.txt)
|
||||||
cd Publisher
|
cd Publisher
|
||||||
|
@ -127,26 +109,20 @@ jobs:
|
||||||
--license "AGPL-3.0" \
|
--license "AGPL-3.0" \
|
||||||
--origin "luncher" \
|
--origin "luncher" \
|
||||||
--maintainer "Internet Addict" \
|
--maintainer "Internet Addict" \
|
||||||
--dependencies "" \
|
|
||||||
--platform "windows" \
|
--platform "windows" \
|
||||||
--icon "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.svg" \
|
--icon "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.svg" \
|
||||||
--screenshots "https://spitfirebrowser.xyz/static/images/screenshots/1.png" \
|
|
||||||
--tags "browser,experimental,testing" \
|
|
||||||
--notes "Automated build of Spitfire" \
|
|
||||||
--remotePath "luncher/amd64/nightly/$DATE/spitfire-luncher-amd64-nightly-windows.tar.gz" \
|
--remotePath "luncher/amd64/nightly/$DATE/spitfire-luncher-amd64-nightly-windows.tar.gz" \
|
||||||
--compressedFile "spitfire-luncher-amd64-nightly-windows.tar.gz" \
|
--compressedFile "spitfire-luncher-amd64-nightly-windows.tar.gz" \
|
||||||
--uncompressedFile "spitfire-luncher.exe"
|
--uncompressedFile "spitfire-luncher.exe"
|
||||||
cp APPINDEX ../
|
cp APPINDEX ../
|
||||||
|
|
||||||
- name: Upload updated APPINDEX for Luncher
|
- name: Upload Updated APPINDEX
|
||||||
shell: bash
|
|
||||||
env:
|
env:
|
||||||
SF_USER: ${{ secrets.SF_USER }}
|
SF_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"
|
||||||
|
|
||||||
- name: Cleanup SSH Key
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
rm -f sf_key
|
rm -rf sf_key upload APPINDEX date.txt
|
Loading…
Add table
Add a link
Reference in a new issue