mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 05:55:42 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f41f663bf | ||
|
|
80d23fc056 |
@@ -6,12 +6,10 @@ on:
|
||||
paths:
|
||||
- ".github/workflows/installer_build.yml"
|
||||
- "src/main/go/net/eagle0/clients/win/installer/**"
|
||||
- "src/main/csharp/net/eagle0/clients/win/installer/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/installer_build.yml"
|
||||
- "src/main/go/net/eagle0/clients/win/installer/**"
|
||||
- "src/main/csharp/net/eagle0/clients/win/installer/**"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -28,12 +26,6 @@ jobs:
|
||||
lfs: false
|
||||
clean: false
|
||||
|
||||
- name: Setup .NET 8
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
# Build Go installer (EagleInstallerMini.exe)
|
||||
- name: Build Go installer for Windows
|
||||
env:
|
||||
MANIFEST_PUBLIC_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
|
||||
@@ -51,33 +43,11 @@ jobs:
|
||||
# Copy to output directory
|
||||
rm -rf ./installer-output
|
||||
mkdir -p ./installer-output
|
||||
cp bazel-bin/src/main/go/net/eagle0/clients/win/installer/EagleInstaller.exe ./installer-output/EagleInstallerMini.exe
|
||||
cp bazel-bin/src/main/go/net/eagle0/clients/win/installer/EagleInstaller.exe ./installer-output/EagleInstaller.exe
|
||||
|
||||
echo "Go installer size: $(ls -lh ./installer-output/EagleInstallerMini.exe | awk '{print $5}')"
|
||||
echo "Go installer size: $(ls -lh ./installer-output/EagleInstaller.exe | awk '{print $5}')"
|
||||
|
||||
# Build .NET installer (EagleInstaller.exe) - transitional, will update users to Go version
|
||||
- name: Inject manifest public key into .NET installer
|
||||
env:
|
||||
MANIFEST_PUBLIC_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
|
||||
run: |
|
||||
if [ -n "$MANIFEST_PUBLIC_KEY" ]; then
|
||||
CONFIG_FILE="src/main/csharp/net/eagle0/clients/win/installer/EagleInstaller/configuration.txt"
|
||||
echo "manifest_public_key = $MANIFEST_PUBLIC_KEY" >> "$CONFIG_FILE"
|
||||
echo "Injected manifest public key into configuration.txt"
|
||||
fi
|
||||
|
||||
- name: Restore .NET dependencies
|
||||
run: dotnet restore src/main/csharp/net/eagle0/clients/win/installer/EagleInstaller/EagleInstaller.csproj
|
||||
|
||||
- name: Build .NET installer
|
||||
run: |
|
||||
dotnet publish src/main/csharp/net/eagle0/clients/win/installer/EagleInstaller/EagleInstaller.csproj \
|
||||
-c Release -r win-x64 --self-contained true --output ./dotnet-output
|
||||
|
||||
cp ./dotnet-output/EagleInstaller.exe ./installer-output/EagleInstaller.exe
|
||||
echo ".NET installer size: $(ls -lh ./installer-output/EagleInstaller.exe | awk '{print $5}')"
|
||||
|
||||
- name: Archive installer binaries
|
||||
- name: Archive installer binary
|
||||
if: success() || failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -85,64 +55,42 @@ jobs:
|
||||
path: ./installer-output/
|
||||
retention-days: 1
|
||||
|
||||
- name: Verify installers exist
|
||||
- name: Verify installer exists
|
||||
if: success()
|
||||
run: |
|
||||
echo "=== Installer output directory ==="
|
||||
ls -lh ./installer-output/
|
||||
|
||||
if [ ! -f "./installer-output/EagleInstallerMini.exe" ]; then
|
||||
echo "ERROR: EagleInstallerMini.exe (Go) not found"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "./installer-output/EagleInstaller.exe" ]; then
|
||||
echo "ERROR: EagleInstaller.exe (.NET) not found"
|
||||
echo "ERROR: EagleInstaller.exe not found"
|
||||
exit 1
|
||||
fi
|
||||
echo "Both installers found"
|
||||
echo "Installer found"
|
||||
|
||||
# Deploy both installers
|
||||
- name: Deploy Go installer (EagleInstallerMini.exe)
|
||||
- name: Deploy installer
|
||||
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
env:
|
||||
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
|
||||
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
||||
run: |
|
||||
# Upload Go installer as EagleInstallerMini.exe
|
||||
INSTALLER_PATH="$(pwd)/installer-output/EagleInstallerMini.exe"
|
||||
echo "Deploying Go installer to installer/EagleInstallerMini.exe"
|
||||
bazel run //src/main/go/net/eagle0/build/installer_build_handler:installer_build_handler -- "$INSTALLER_PATH" "installer/EagleInstallerMini.exe"
|
||||
|
||||
- name: Deploy .NET installer (EagleInstaller.exe)
|
||||
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
env:
|
||||
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
|
||||
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
||||
run: |
|
||||
# Upload .NET installer to standard path
|
||||
INSTALLER_PATH="$(pwd)/installer-output/EagleInstaller.exe"
|
||||
echo "Deploying .NET installer to installer/EagleInstaller.exe"
|
||||
echo "Deploying Go installer to installer/EagleInstaller.exe"
|
||||
bazel run //src/main/go/net/eagle0/build/installer_build_handler:installer_build_handler -- "$INSTALLER_PATH"
|
||||
|
||||
# Two-stage manifest update for clean upgrade path:
|
||||
# 1. OLD manifest (installer/) -> points to .NET installer (for old clients)
|
||||
# 2. NEW manifest (installer/v2/) -> points to Go installer (for new .NET and Go clients)
|
||||
- name: Update OLD manifest (points to .NET installer)
|
||||
- name: Update manifest
|
||||
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
env:
|
||||
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
|
||||
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
||||
MANIFEST_SIGNING_KEY: ${{ secrets.MANIFEST_SIGNING_KEY }}
|
||||
run: |
|
||||
# OLD manifest points to .NET installer
|
||||
# This allows old .NET installers (without Zone.Identifier fix) to update to new .NET
|
||||
DOTNET_INSTALLER_SHA=$(sha256sum ./installer-output/EagleInstaller.exe | cut -d' ' -f1)
|
||||
echo "installer_version=$DOTNET_INSTALLER_SHA" > /tmp/installer_manifest_old.txt
|
||||
echo "installer_url=installer/EagleInstaller.exe" >> /tmp/installer_manifest_old.txt
|
||||
INSTALLER_SHA=$(sha256sum ./installer-output/EagleInstaller.exe | cut -d' ' -f1)
|
||||
echo "installer_version=$INSTALLER_SHA" > /tmp/installer_manifest.txt
|
||||
echo "installer_url=installer/EagleInstaller.exe" >> /tmp/installer_manifest.txt
|
||||
|
||||
echo "=== OLD manifest content (points to .NET) ==="
|
||||
cat /tmp/installer_manifest_old.txt
|
||||
echo "=============================================="
|
||||
echo "=== Manifest content ==="
|
||||
cat /tmp/installer_manifest.txt
|
||||
echo "========================"
|
||||
|
||||
# Write signing key to temp file (if available)
|
||||
SIGNING_ARGS=""
|
||||
@@ -155,41 +103,8 @@ jobs:
|
||||
echo "Warning: MANIFEST_SIGNING_KEY not set, manifest will be unsigned"
|
||||
fi
|
||||
|
||||
# Update the OLD manifest at installer/eagle0_manifest.txt
|
||||
bazel run //src/main/go/net/eagle0/build/manifest_manager:manifest_manager -- installer /tmp/installer_manifest_old.txt $SIGNING_ARGS
|
||||
|
||||
rm -f /tmp/manifest_signing_key
|
||||
|
||||
- name: Update NEW manifest v2 (points to Go installer)
|
||||
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
env:
|
||||
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
|
||||
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
||||
MANIFEST_SIGNING_KEY: ${{ secrets.MANIFEST_SIGNING_KEY }}
|
||||
run: |
|
||||
# NEW manifest (v2) points to Go installer
|
||||
# New .NET installer and Go installer both check this manifest
|
||||
GO_INSTALLER_SHA=$(sha256sum ./installer-output/EagleInstallerMini.exe | cut -d' ' -f1)
|
||||
echo "installer_version=$GO_INSTALLER_SHA" > /tmp/installer_manifest_v2.txt
|
||||
echo "installer_url=installer/EagleInstallerMini.exe" >> /tmp/installer_manifest_v2.txt
|
||||
|
||||
echo "=== NEW manifest v2 content (points to Go) ==="
|
||||
cat /tmp/installer_manifest_v2.txt
|
||||
echo "==============================================="
|
||||
|
||||
# Write signing key to temp file (if available)
|
||||
SIGNING_ARGS=""
|
||||
if [ -n "$MANIFEST_SIGNING_KEY" ]; then
|
||||
echo "$MANIFEST_SIGNING_KEY" > /tmp/manifest_signing_key
|
||||
chmod 600 /tmp/manifest_signing_key
|
||||
SIGNING_ARGS="/tmp/manifest_signing_key"
|
||||
echo "Manifest signing key available"
|
||||
else
|
||||
echo "Warning: MANIFEST_SIGNING_KEY not set, manifest will be unsigned"
|
||||
fi
|
||||
|
||||
# Update the NEW manifest at installer/v2/eagle0_manifest.txt
|
||||
bazel run //src/main/go/net/eagle0/build/manifest_manager:manifest_manager -- installer-v2 /tmp/installer_manifest_v2.txt $SIGNING_ARGS
|
||||
# Update the v2 manifest at installer/v2/eagle0_manifest.txt
|
||||
bazel run //src/main/go/net/eagle0/build/manifest_manager:manifest_manager -- installer-v2 /tmp/installer_manifest.txt $SIGNING_ARGS
|
||||
|
||||
rm -f /tmp/manifest_signing_key
|
||||
|
||||
|
||||
@@ -96,13 +96,7 @@ jobs:
|
||||
echo "Warning: MANIFEST_SIGNING_KEY not set, manifest will be unsigned"
|
||||
fi
|
||||
|
||||
# Update the OLD manifest at installer/eagle0_manifest.txt
|
||||
echo "Updating OLD manifest (installer/)..."
|
||||
bazel run //src/main/go/net/eagle0/build/manifest_manager:manifest_manager -- unity3d /tmp/unity_manifest.txt $SIGNING_ARGS
|
||||
|
||||
# Update the V2 manifest at installer/v2/eagle0_manifest.txt
|
||||
# This is needed for the new Go installer which checks the v2 path
|
||||
echo "Updating V2 manifest (installer/v2/)..."
|
||||
# Update the v2 manifest at installer/v2/eagle0_manifest.txt
|
||||
bazel run //src/main/go/net/eagle0/build/manifest_manager:manifest_manager -- unity3d-v2 /tmp/unity_manifest.txt $SIGNING_ARGS
|
||||
|
||||
# Cleanup
|
||||
|
||||
@@ -77,8 +77,18 @@ func showHelp() {
|
||||
}
|
||||
|
||||
func cleanupTempInstallerFiles() {
|
||||
// Clean up temp download directory
|
||||
tempDir := filepath.Join(os.TempDir(), "eagle0_installer_update")
|
||||
os.RemoveAll(tempDir)
|
||||
|
||||
// Clean up backup file from previous self-update
|
||||
currentPath, err := os.Executable()
|
||||
if err == nil {
|
||||
backupPath := currentPath + ".backup"
|
||||
if _, err := os.Stat(backupPath); err == nil {
|
||||
os.Remove(backupPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func runInstallerLogic(invitationCode string) error {
|
||||
|
||||
Reference in New Issue
Block a user