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
219 changes: 219 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
name: Build and Publish WinUI 3 Single File

on:
push:
branches: [ main, master, develop ]
paths-ignore:
- '**.md'
- '.gitignore'
- 'LICENSE'
pull_request:
branches: [ main, master ]
release:
types: [ published ]
workflow_dispatch:
inputs:
create_release:
description: 'Create GitHub Release'
required: false
default: false
type: boolean

env:
PROJECT_PATH: 'Windows Desktop Script UI/Windows Desktop Script UI.csproj'
SOLUTION_PATH: 'Windows Desktop Script UI.sln'
DOTNET_VERSION: '8.0.x'
BUILD_CONFIGURATION: Release

jobs:
build-and-publish:
runs-on: windows-latest

strategy:
matrix:
platform: [x64, x86, ARM64]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Install Windows SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.11
with:
sdk-version: 22621

- name: Restore NuGet packages
run: |
dotnet restore "${{ env.PROJECT_PATH }}" --verbosity normal
working-directory: .

- name: Build solution
run: |
dotnet build "${{ env.PROJECT_PATH }}" `
--configuration ${{ env.BUILD_CONFIGURATION }} `
--platform ${{ matrix.platform }} `
--no-restore `
--verbosity normal
working-directory: .

- name: Publish single-file application
run: |
dotnet publish "${{ env.PROJECT_PATH }}" `
--configuration ${{ env.BUILD_CONFIGURATION }} `
--platform ${{ matrix.platform }} `
--runtime win-${{ matrix.platform }} `
--self-contained true `
--output "publish/win-${{ matrix.platform }}" `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-p:IncludeAllContentForSelfExtract=true `
-p:WindowsAppSDKSelfContained=true `
-p:EnableCompressionInSingleFile=true `
-p:PublishTrimmed=false `
-p:SatelliteResourceLanguages=en `
--verbosity normal
working-directory: .

- name: Create artifact name with timestamp
id: artifact_name
run: |
$timestamp = Get-Date -Format "yyyy-MM-dd-HHmm"
$artifactName = "WindowsDesktopScriptUI-win-${{ matrix.platform }}-$timestamp"
echo "artifact_name=$artifactName" >> $env:GITHUB_OUTPUT
echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT
shell: pwsh

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact_name.outputs.artifact_name }}
path: |
publish/win-${{ matrix.platform }}/*.exe
publish/win-${{ matrix.platform }}/*.pdb
retention-days: 90

- name: Get executable info
id: exe_info
run: |
$exePath = "publish/win-${{ matrix.platform }}/Windows Desktop Script UI.exe"
if (Test-Path $exePath) {
$fileInfo = Get-Item $exePath
$sizeInMB = [math]::Round($fileInfo.Length / 1MB, 2)
echo "exe_size=$sizeInMB MB" >> $env:GITHUB_OUTPUT
echo "exe_exists=true" >> $env:GITHUB_OUTPUT
} else {
echo "exe_exists=false" >> $env:GITHUB_OUTPUT
}
shell: pwsh

- name: Create release assets (on release)
if: github.event_name == 'release'
run: |
$exePath = "publish/win-${{ matrix.platform }}/Windows Desktop Script UI.exe"
$newName = "WindowsDesktopScriptUI-${{ github.ref_name }}-win-${{ matrix.platform }}.exe"

if (Test-Path $exePath) {
Copy-Item $exePath $newName
echo "Created release asset: $newName"
}
shell: pwsh

- name: Upload release assets
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: WindowsDesktopScriptUI-${{ github.ref_name }}-win-${{ matrix.platform }}.exe
asset_name: WindowsDesktopScriptUI-${{ github.ref_name }}-win-${{ matrix.platform }}.exe
asset_content_type: application/octet-stream

create-manual-release:
runs-on: ubuntu-latest
needs: build-and-publish
if: ${{ github.event.inputs.create_release == 'true' && github.event_name == 'workflow_dispatch' }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Generate release tag
id: generate_tag
run: |
timestamp=$(date +%Y.%m.%d.%H%M)
echo "tag=v$timestamp" >> $GITHUB_OUTPUT
echo "release_name=Windows Desktop Script UI v$timestamp" >> $GITHUB_OUTPUT

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.generate_tag.outputs.tag }}
release_name: ${{ steps.generate_tag.outputs.release_name }}
draft: false
prerelease: false
body: |
## Windows Desktop Script UI Release

**Build Information:**
- **Commit:** ${{ github.sha }}
- **Branch:** ${{ github.ref_name }}
- **Build Date:** ${{ github.event.head_commit.timestamp }}

**Features:**
- Self-contained single-file executable
- No .NET runtime installation required
- Supports Windows 10/11
- Available for x64, x86, and ARM64 architectures

**Download the appropriate version for your system:**
- **x64**: Most common (64-bit Intel/AMD processors)
- **x86**: Legacy 32-bit systems
- **ARM64**: ARM-based processors (Surface Pro X, etc.)

## Installation
1. Download the appropriate `.exe` file for your architecture
2. Run the executable directly - no installation required!

## Usage
```
WindowsDesktopScriptUI-*.exe --WatchPath=<FILE> [OPTIONS] [FLAGS]
```

For more information, run with `--help` flag.

- name: Upload release assets
run: |
for platform in x64 x86 ARM64; do
artifact_dir=$(find artifacts -name "*win-$platform*" -type d | head -1)
if [ -d "$artifact_dir" ]; then
exe_file=$(find "$artifact_dir" -name "*.exe" | head -1)
if [ -f "$exe_file" ]; then
asset_name="WindowsDesktopScriptUI-${{ steps.generate_tag.outputs.tag }}-win-$platform.exe"
cp "$exe_file" "$asset_name"

# Upload using GitHub CLI
gh release upload ${{ steps.generate_tag.outputs.tag }} "$asset_name" --clobber
fi
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125 changes: 125 additions & 0 deletions .github/workflows/quick-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Quick Release

on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.0.0)'
required: true
default: 'v1.0.0'
prerelease:
description: 'Mark as pre-release'
required: false
default: false
type: boolean

jobs:
quick-release:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build and publish x64 (primary platform)
run: |
dotnet publish "Windows Desktop Script UI/Windows Desktop Script UI.csproj" `
--configuration Release `
--platform x64 `
--runtime win-x64 `
--self-contained true `
--output "release-output" `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-p:IncludeAllContentForSelfExtract=true `
-p:WindowsAppSDKSelfContained=true `
-p:EnableCompressionInSingleFile=true `
-p:PublishTrimmed=false `
-p:SatelliteResourceLanguages=en `
--verbosity normal

- name: Prepare release asset
run: |
$exePath = "release-output/Windows Desktop Script UI.exe"
$releaseName = "WindowsDesktopScriptUI-${{ github.event.inputs.version }}.exe"

if (Test-Path $exePath) {
Copy-Item $exePath $releaseName
$fileInfo = Get-Item $releaseName
$sizeInMB = [math]::Round($fileInfo.Length / 1MB, 2)
echo "File created: $releaseName ($sizeInMB MB)"
} else {
echo "Error: Executable not found at $exePath"
exit 1
}
shell: pwsh

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Windows Desktop Script UI ${{ github.event.inputs.version }}
draft: false
prerelease: ${{ github.event.inputs.prerelease }}
body: |
## Windows Desktop Script UI ${{ github.event.inputs.version }}

**Single-file executable for Windows 10/11 (x64)**

### What's New
- Self-contained application (no .NET runtime required)
- Single executable file (~66MB)
- Dynamic UI generation based on external commands
- File watching capabilities
- Modern Windows 11 design with Acrylic backdrop

### System Requirements
- Windows 10 version 1903 (build 18362) or later
- Windows 11 (recommended)
- x64 architecture

### Installation
1. Download `WindowsDesktopScriptUI-${{ github.event.inputs.version }}.exe`
2. Run directly - no installation required!

### Usage
```
WindowsDesktopScriptUI-${{ github.event.inputs.version }}.exe --WatchPath="path/to/your/script.txt" [OPTIONS]
```

**Available Options:**
- `--WindowTitle="My Window"` - Set custom window title
- `--WelcomeMessage="Hello!"` - Set welcome message
- `--Height=600 --Width=800` - Set window dimensions
- `-FullScreen` - Launch in full screen
- `-AlwaysOnTop` - Keep window always on top
- `-Debug` - Enable debug logging

### Commands (in watch file)
- `MainText --Text="Your title"`
- `SubText --Text="Your subtitle"`
- `MainImage --Source="image.jpg"`
- `Load --Text="Loading..." --Type=Indeterminate`
- `Input --Type=Text --Header="Enter name"`
- And many more...

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: WindowsDesktopScriptUI-${{ github.event.inputs.version }}.exe
asset_name: WindowsDesktopScriptUI-${{ github.event.inputs.version }}.exe
asset_content_type: application/octet-stream
Loading
Loading