Publisher/.forgejo/workflows/Installer_Windows-AMD64-Nightly.yaml

128 lines
4.7 KiB
YAML
Raw Normal View History

2025-02-12 18:02:16 +00:00
name: Build Installer for Windows/AMD64/Nightly
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
2025-02-12 18:02:16 +00:00
jobs:
build:
runs-on: alpine-1.20
2025-02-12 18:02:16 +00:00
steps:
- name: Setup Environment
run: |
export LOCAL_BIN="$HOME/.local/bin"
mkdir -p "$LOCAL_BIN"
export PATH="$PATH:$LOCAL_BIN:$HOME/go/bin"
- name: Verify Tools
2025-02-12 18:02:16 +00:00
run: |
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: Clone Repositories
run: |
git clone https://weforge.xyz/Spitfire/Publisher.git
git clone https://weforge.xyz/Spitfire/Installer.git
- name: Generate Manifest Files
shell: bash
run: |
2025-02-18 13:54:56 +00:00
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" \
--description "Official Installer for Spitfire Browser" \
--official "https://spitfirebrowser.xyz" \
--dev "https://weforge.xyz" \
--requireAdmin=true
2025-02-18 13:54:56 +00:00
# Copy generated files (app.manifest and app.rc) to the workspace root.
cp app.manifest ../Installer/
cp app.rc ../Installer/
2025-02-18 13:54:56 +00:00
cd ..
- name: Build Windows Installer
working-directory: ./Installer
2025-02-12 18:02:16 +00:00
run: |
2025-02-18 13:54:56 +00:00
curl -fL "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.png" -o icon.png
magick icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
echo '1 ICON "icon.ico"' >> app.rc
x86_64-w64-mingw32-windres app.rc -O coff -o app.syso
$HOME/go/bin/rsrc -manifest app.manifest -o rsrc.syso
# Verify syso files exist
ls -la *.syso
2025-02-18 13:54:56 +00:00
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 \
go build -ldflags "-s -w -H=windowsgui" -o spitfire-installer.exe
# Verify executable metadata
exiftool spitfire-installer.exe
upx --best spitfire-installer.exe
- name: Setup SSH Key
2025-02-12 18:02:16 +00:00
env:
SF_SSH_KEY: ${{ secrets.SF_SSH_KEY }}
run: |
echo "${SF_SSH_KEY}" > sf_key
2025-02-12 18:02:16 +00:00
chmod 600 sf_key
2025-02-18 13:54:56 +00:00
- name: Download APPINDEX
2025-02-12 18:02:16 +00:00
env:
SF_USER: ${{ secrets.SF_USER }}
run: |
scp -i sf_key -vvv -o IdentitiesOnly=yes "$SF_USER@frs.sourceforge.net:/home/frs/project/spitfire-browser/APPINDEX" APPINDEX || true
2025-02-18 13:54:56 +00:00
- name: Prepare Artifact
2025-02-12 18:02:16 +00:00
run: |
DATE=$(date +'%Y.%m.%d')
mkdir -p upload/installer/amd64/nightly/$DATE
tar -czf upload/installer/amd64/nightly/$DATE/spitfire-installer-amd64-nightly-windows.tar.gz -C Installer spitfire-installer.exe
2025-02-12 18:02:16 +00:00
echo "$DATE" > date.txt
2025-02-18 13:54:56 +00:00
- name: Upload Artifact
2025-02-12 18:02:16 +00:00
env:
SF_USER: ${{ secrets.SF_USER }}
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/"
2025-02-18 13:54:56 +00:00
2025-02-12 18:02:16 +00:00
- name: Update APPINDEX
run: |
DATE=$(cat date.txt)
cd Publisher
cp ../APPINDEX . || true
go run update_appindex.go \
--name "spitfire-installer" \
--release "nightly" \
--version "$DATE" \
--arch "amd64" \
--description "Nightly build" \
--url "https://spitfirebrowser.xyz/" \
--license "AGPL-3.0" \
--origin "installer" \
--maintainer "Internet Addict" \
--platform "windows" \
--icon "https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.svg" \
--remotePath "installer/amd64/nightly/$DATE/spitfire-installer-amd64-nightly-windows.tar.gz" \
--compressedFile "spitfire-installer-amd64-nightly-windows.tar.gz" \
--uncompressedFile "spitfire-installer.exe"
cp APPINDEX ../
2025-02-18 13:54:56 +00:00
- name: Upload Updated APPINDEX
2025-02-12 18:02:16 +00:00
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"
2025-02-18 13:54:56 +00:00
- name: Cleanup
2025-02-12 18:02:16 +00:00
if: always()
run: |
rm -rf sf_key upload APPINDEX date.txt