Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 87 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
echo "✓ All validation checks passed"
shell: pwsh

- name: Publish Application as Single File
- name: Publish Full Install (Self-Contained)
run: |
try {
$version = git describe --tags --abbrev=0 2>$null
Expand All @@ -52,49 +52,118 @@ jobs:
}
echo "Building version: $version"

# Create full install (self-contained with .NET runtime)
echo "Creating full install package..."
dotnet publish GateSwitchWay.csproj `
--configuration Release `
--runtime win-x64 `
--self-contained true `
--output "publish" `
--output "publish-full" `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-p:PublishTrimmed=false `
-p:AssemblyName="GateSwitchWay-$version"
-p:AssemblyName="GateSwitchWay-$version-full"

# Verify the executable was created
$exePath = "publish\GateSwitchWay-$version.exe"
if (Test-Path $exePath) {
$size = (Get-Item $exePath).Length
echo "Successfully created executable: $exePath (Size: $([math]::Round($size / 1MB, 2)) MB)"
# Verify the full install executable was created
$exePathFull = "publish-full\GateSwitchWay-$version-full.exe"
if (Test-Path $exePathFull) {
$sizeFull = (Get-Item $exePathFull).Length
echo "Successfully created full install: $exePathFull (Size: $([math]::Round($sizeFull / 1MB, 2)) MB)"
# Copy to root for artifact upload
Copy-Item $exePath "GateSwitchWay-$version.exe"
Copy-Item $exePathFull "GateSwitchWay-$version-full.exe"
} else {
echo "ERROR: Executable not found at $exePath"
echo "ERROR: Full install executable not found at $exePathFull"
exit 1
}
shell: pwsh

- name: Upload Published Artifacts
- name: Publish Update Package (Framework-Dependent)
run: |
try {
$version = git describe --tags --abbrev=0 2>$null
if ($LASTEXITCODE -ne 0) {
$version = "0.0.0"
}
} catch {
$version = "0.0.0"
}

# Create update package (framework-dependent, requires .NET 8 runtime)
echo "Creating update package..."
dotnet publish GateSwitchWay.csproj `
--configuration Release `
--runtime win-x64 `
--self-contained false `
--output "publish-update" `
-p:PublishSingleFile=true `
-p:AssemblyName="GateSwitchWay-$version-update"

# Verify the update executable was created
$exePathUpdate = "publish-update\GateSwitchWay-$version-update.exe"
if (Test-Path $exePathUpdate) {
$sizeUpdate = (Get-Item $exePathUpdate).Length
echo "Successfully created update package: $exePathUpdate (Size: $([math]::Round($sizeUpdate / 1KB, 2)) KB)"
# Copy to root for artifact upload
Copy-Item $exePathUpdate "GateSwitchWay-$version-update.exe"
} else {
echo "ERROR: Update executable not found at $exePathUpdate"
exit 1
}
shell: pwsh

- name: Upload Full Install Artifacts
uses: actions/upload-artifact@v4
with:
name: full-install
path: GateSwitchWay-*-full.exe

- name: Upload Update Package Artifacts
uses: actions/upload-artifact@v4
with:
name: published-artifacts
path: GateSwitchWay-*.exe
name: update-package
path: GateSwitchWay-*-update.exe

- name: Artifact Information
run: |
echo "Build completed successfully!"
echo "Artifact details:"
Get-ChildItem "GateSwitchWay-*.exe" | ForEach-Object {
echo ""
echo "=== FULL INSTALL PACKAGE ==="
Get-ChildItem "GateSwitchWay-*-full.exe" | ForEach-Object {
$size = [math]::Round($_.Length / 1MB, 2)
echo " - File: $($_.Name)"
echo " - Size: $size MB"
echo " - Created: $($_.CreationTime)"
echo " - Use case: Clean installation (includes .NET runtime)"
echo " - Requirements: None - runs on any Windows system"
}
echo ""
echo "=== UPDATE PACKAGE ==="
Get-ChildItem "GateSwitchWay-*-update.exe" | ForEach-Object {
$size = [math]::Round($_.Length / 1KB, 2)
echo " - File: $($_.Name)"
echo " - Size: $size KB"
echo " - Use case: Updates for existing installations"
echo " - Requirements: .NET 8 runtime must be pre-installed"
}
echo ""
echo "Download instructions:"
echo "=== DOWNLOAD INSTRUCTIONS ==="
echo "1. Go to the Actions tab in GitHub"
echo "2. Click on this workflow run"
echo "3. Download the 'published-artifacts' zip file"
echo "3. Choose the appropriate download:"
echo " - 'full-install' for new installations (~60MB)"
echo " - 'update-package' for updates (~0.5MB, requires .NET 8)"
echo "4. Extract and run as Administrator (required for network configuration)"
echo ""
echo "=== PACKAGE COMPARISON ==="
$fullFiles = Get-ChildItem "GateSwitchWay-*-full.exe"
$updateFiles = Get-ChildItem "GateSwitchWay-*-update.exe"
if ($fullFiles -and $updateFiles) {
$fullSize = $fullFiles[0].Length
$updateSize = $updateFiles[0].Length
$ratio = [math]::Round($fullSize / $updateSize, 1)
echo " - Full install: $([math]::Round($fullSize / 1MB, 1)) MB"
echo " - Update package: $([math]::Round($updateSize / 1KB, 1)) KB"
echo " - Size reduction: ${ratio}x smaller for updates"
} else {
echo " - Could not compare sizes (files not found)"
}
shell: pwsh
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,51 @@ The application allows users to configure the following settings:

## Requirements

- .NET 8
- Windows operating system
- .NET 8 (for update packages only - full install includes .NET runtime)

## Installation

### option 1:
1. ~~Download the latest release from the [releases page](#).~~
2. ~~Run the installer and follow the on-screen instructions.~~
Choose the appropriate package based on your needs:

### option 2:
1. Download latest version from [`Actions`](https://github.com/lsd-techno/GateSwitchWay/actions) page, `published-artifacts` from latest successful run
2. Unzip, start, use...
### Full Install (New Installation)
**Size:** ~60MB | **Requirements:** None

1. Go to [`Actions`](https://github.com/lsd-techno/GateSwitchWay/actions) page
2. Click on the latest successful workflow run
3. Download the `full-install` artifact
4. Extract and run `GateSwitchWay-{version}-full.exe` as Administrator

*Use this option if you don't have .NET 8 installed or for clean installations.*

### Update Package (Existing Installation)
**Size:** ~0.5MB | **Requirements:** .NET 8 runtime pre-installed

1. Go to [`Actions`](https://github.com/lsd-techno/GateSwitchWay/actions) page
2. Click on the latest successful workflow run
3. Download the `update-package` artifact
4. Extract and run `GateSwitchWay-{version}-update.exe` as Administrator

*Use this option for updates if you already have .NET 8 installed. Downloads 120x faster than full install.*

### .NET 8 Runtime Installation
If you choose the update package but don't have .NET 8 installed:
1. Download .NET 8 Runtime from [Microsoft's official site](https://dotnet.microsoft.com/download/dotnet/8.0)
2. Install the **Desktop Runtime** (not just the runtime)
3. Then use the update package for future updates

### Package Comparison

| Feature | Full Install | Update Package |
|---------|-------------|----------------|
| **Size** | ~60MB | ~0.5MB |
| **Download Time** | Slower | 120x faster |
| **Requirements** | None | .NET 8 runtime |
| **Use Case** | New installations | Updates |
| **Includes .NET Runtime** | ✅ Yes | ❌ No |
| **Offline Installation** | ✅ Yes | ❌ Requires .NET 8 |

**Recommendation:** Use full install for your first installation, then switch to update packages for future updates to save bandwidth and time.

## License

Expand Down