diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..332642b --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -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= [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 }} \ No newline at end of file diff --git a/.github/workflows/quick-release.yml b/.github/workflows/quick-release.yml new file mode 100644 index 0000000..b8ecf5e --- /dev/null +++ b/.github/workflows/quick-release.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release-all-platforms.yml b/.github/workflows/release-all-platforms.yml new file mode 100644 index 0000000..67e6b37 --- /dev/null +++ b/.github/workflows/release-all-platforms.yml @@ -0,0 +1,287 @@ +name: Release All Platforms + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., v1.0.0)' + required: true + default: 'v1.0.0' + release_notes: + description: 'Release notes (optional)' + required: false + default: '' + prerelease: + description: 'Mark as pre-release' + required: false + default: false + type: boolean + +jobs: + build-all-platforms: + runs-on: windows-latest + + strategy: + matrix: + include: + - platform: x64 + runtime: win-x64 + display_name: "64-bit Intel/AMD" + - platform: x86 + runtime: win-x86 + display_name: "32-bit Legacy" + - platform: ARM64 + runtime: win-arm64 + display_name: "ARM64 (Surface Pro X)" + + 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 ${{ matrix.platform }} + run: | + Write-Host "Building for ${{ matrix.platform }} (${{ matrix.display_name }})" + + dotnet publish "Windows Desktop Script UI/Windows Desktop Script UI.csproj" ` + --configuration Release ` + --platform ${{ matrix.platform }} ` + --runtime ${{ matrix.runtime }} ` + --self-contained true ` + --output "build-output/${{ 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 + shell: pwsh + + - name: Prepare release asset + id: prepare_asset + run: | + $exePath = "build-output/${{ matrix.platform }}/Windows Desktop Script UI.exe" + $assetName = "WindowsDesktopScriptUI-${{ github.event.inputs.version }}-${{ matrix.runtime }}.exe" + + if (Test-Path $exePath) { + Copy-Item $exePath $assetName + $fileInfo = Get-Item $assetName + $sizeInMB = [math]::Round($fileInfo.Length / 1MB, 2) + + echo "asset_name=$assetName" >> $env:GITHUB_OUTPUT + echo "asset_size=$sizeInMB" >> $env:GITHUB_OUTPUT + echo "success=true" >> $env:GITHUB_OUTPUT + + Write-Host "? Created: $assetName ($sizeInMB MB)" + } else { + echo "success=false" >> $env:GITHUB_OUTPUT + Write-Host "? Failed to create executable for ${{ matrix.platform }}" + exit 1 + } + shell: pwsh + + - name: Upload platform artifact + uses: actions/upload-artifact@v4 + with: + name: release-${{ matrix.runtime }} + path: WindowsDesktopScriptUI-${{ github.event.inputs.version }}-${{ matrix.runtime }}.exe + retention-days: 30 + + create-release: + runs-on: ubuntu-latest + needs: build-all-platforms + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: release-assets + + - name: List release assets + run: | + echo "Release assets created:" + find release-assets -name "*.exe" -exec basename {} \; | sort + + - name: Generate release notes + id: release_notes + run: | + cat << 'EOF' > release_body.md + # Windows Desktop Script UI ${{ github.event.inputs.version }} + + ?? **Single-file executables for Windows 10/11** - No installation required! + + ## ?? Downloads + + Choose the right version for your system: + + | Platform | Recommended For | Download | + |----------|----------------|----------| + | **x64** | Most desktop PCs, laptops (Intel/AMD 64-bit) | `WindowsDesktopScriptUI-${{ github.event.inputs.version }}-win-x64.exe` | + | **x86** | Older 32-bit systems, legacy compatibility | `WindowsDesktopScriptUI-${{ github.event.inputs.version }}-win-x86.exe` | + | **ARM64** | Surface Pro X, ARM-based Windows devices | `WindowsDesktopScriptUI-${{ github.event.inputs.version }}-win-arm64.exe` | + + > ?? **Not sure which one?** Choose **x64** for modern Windows computers. + + ## ? Features + + - ?? **Self-contained** - No .NET runtime installation required + - ?? **Dynamic UI** - Creates forms and interfaces based on external commands + - ?? **File watching** - Monitors files for changes and updates UI accordingly + - ?? **Modern design** - Windows 11 Acrylic backdrop and styling + - ? **Single file** - Everything bundled in one executable (~66MB) + - ?? **Command-driven** - Powerful scripting interface for UI automation + + ## ??? System Requirements + + - **Windows 10** version 1903 (build 18362) or later + - **Windows 11** (recommended for best experience) + - Appropriate CPU architecture (x64/x86/ARM64) + + ## ?? Quick Start + + 1. **Download** the appropriate `.exe` file for your system + 2. **Run** the executable directly - no installation needed! + 3. **Create** a text file to control the UI (see usage examples below) + + ### Basic Usage + ```bash + WindowsDesktopScriptUI-${{ github.event.inputs.version }}-win-x64.exe --WatchPath="control.txt" + ``` + + ### Advanced Options + ```bash + # Custom window settings + WindowsDesktopScriptUI.exe --WatchPath="script.txt" --WindowTitle="My App" --Width=800 --Height=600 + + # Full screen mode + WindowsDesktopScriptUI.exe --WatchPath="script.txt" -FullScreen + + # Always on top + WindowsDesktopScriptUI.exe --WatchPath="script.txt" -AlwaysOnTop + + # Debug mode + WindowsDesktopScriptUI.exe --WatchPath="script.txt" -Debug + ``` + + ## ?? Control Commands + + Add these commands to your watch file to control the UI: + + ``` + # Set window content + MainText --Text="Welcome to my application!" + SubText --Text="Please follow the instructions below" + MainImage --Source="logo.jpg" --Width=200 + + # Show loading screen + Load --Text="Processing your request..." --Type=Indeterminate + + # Create input forms + Input --Type=Text --Header="Enter your name" --Out="output.txt" + Input --Type=Password --Header="Enter password" + Input --Type=ComboBox --Header="Choose option" --AllowedValues="Option1|Option2|Option3" + Input --Type=ImageChooser --AllowedValues="img1.jpg#Image 1|img2.jpg#Image 2" + + # Hide elements + Load -Hide + Input -Hide + + # Terminate application + Terminate + ``` + + ## ?? Documentation + + ### Available Input Types + - **Text** - Single line text input + - **Password** - Masked password input + - **ComboBox** - Dropdown selection + - **ImageChooser** - Visual image selection grid + - **Button** - Simple button input + - **ButtonImage** - Image display button + - **ButtonVideo** - Video player with controls + - **ButtonText** - Text-based button + + ### Command Line Options + | Option | Description | Example | + |--------|-------------|---------| + | `--WatchPath` | **Required** - File to monitor for commands | `--WatchPath="commands.txt"` | + | `--WindowTitle` | Set custom window title | `--WindowTitle="My Application"` | + | `--WelcomeMessage` | Set initial welcome text | `--WelcomeMessage="Hello World!"` | + | `--Height` | Set window height in pixels | `--Height=600` | + | `--Width` | Set window width in pixels | `--Width=800` | + | `-FullScreen` | Launch in full screen mode | `-FullScreen` | + | `-AlwaysOnTop` | Keep window always on top | `-AlwaysOnTop` | + | `-Debug` | Enable debug logging | `-Debug` | + | `-h`, `-Help` | Show help message | `-Help` | + + ## ?? Build Information + + - **Framework:** .NET 8.0 + - **UI Framework:** WinUI 3 (Windows App SDK) + - **Build Date:** $(date -u +%Y-%m-%d) + - **Commit:** ${{ github.sha }} + - **Branch:** ${{ github.ref_name }} + + EOF + + # Add custom release notes if provided + if [ -n "${{ github.event.inputs.release_notes }}" ]; then + echo "" >> release_body.md + echo "## ?? Release Notes" >> release_body.md + echo "" >> release_body.md + echo "${{ github.event.inputs.release_notes }}" >> release_body.md + fi + + echo "Generated release notes:" + cat release_body.md + + - name: Create GitHub 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 }} + body_path: release_body.md + draft: false + prerelease: ${{ github.event.inputs.prerelease }} + + - name: Upload all release assets + run: | + # Upload each platform executable + for exe_file in release-assets/*/WindowsDesktopScriptUI-*.exe; do + if [ -f "$exe_file" ]; then + asset_name=$(basename "$exe_file") + echo "Uploading: $asset_name" + + # Get file size for logging + size_mb=$(du -m "$exe_file" | cut -f1) + echo "File size: ${size_mb}MB" + + # Upload using GitHub CLI + gh release upload ${{ github.event.inputs.version }} "$exe_file" --clobber + + echo "? Successfully uploaded: $asset_name" + fi + done + + echo "" + echo "?? Release ${{ github.event.inputs.version }} created successfully!" + echo "?? All platform executables have been uploaded." + echo "?? View release: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.event.inputs.version }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/GITHUB_ACTIONS_README.md b/GITHUB_ACTIONS_README.md new file mode 100644 index 0000000..25a3584 --- /dev/null +++ b/GITHUB_ACTIONS_README.md @@ -0,0 +1,198 @@ +# GitHub Actions Workflows for Windows Desktop Script UI + +This repository now includes automated GitHub Actions workflows for building and publishing your WinUI 3 application as single-file executables. + +## ?? Available Workflows + +### 1. **Build and Publish** (`build-and-publish.yml`) +**Triggers:** +- Push to `main`, `master`, or `develop` branches +- Pull requests to `main` or `master` +- Manual dispatch with optional release creation +- GitHub releases + +**What it does:** +- Builds for **x64**, **x86**, and **ARM64** platforms +- Creates single-file executables for each platform +- Uploads build artifacts +- Automatically attaches executables to GitHub releases + +### 2. **Quick Release** (`quick-release.yml`) +**Triggers:** +- Manual dispatch only + +**What it does:** +- Quick build for x64 platform only +- Creates immediate GitHub release +- Perfect for rapid releases + +## ?? How to Use + +### Option 1: Automatic Build on Push +1. Simply push your code to `main`, `master`, or `develop` +2. GitHub Actions will automatically build and create artifacts +3. Download artifacts from the Actions tab + +### Option 2: Create a Release +1. Go to **Actions** ? **Quick Release** +2. Click **Run workflow** +3. Enter version (e.g., `v1.2.3`) +4. Choose if it's a pre-release +5. Click **Run workflow** +6. Your release will be created with the executable attached! + +### Option 3: Manual Build with Release +1. Go to **Actions** ? **Build and Publish** +2. Click **Run workflow** +3. Check "Create GitHub Release" if desired +4. Click **Run workflow** + +## ?? What You Get + +### Build Artifacts +Each successful build creates artifacts containing: +- `Windows Desktop Script UI.exe` - Single-file executable (~66MB) +- `Windows Desktop Script UI.pdb` - Debug symbols + +### Release Assets +When creating releases, you get: +- **x64**: `WindowsDesktopScriptUI-v1.0.0-win-x64.exe` +- **x86**: `WindowsDesriptScriptUI-v1.0.0-win-x86.exe` +- **ARM64**: `WindowsDesktopScriptUI-v1.0.0-win-ARM64.exe` + +## ?? Workflow Features + +### ? **Automated Features** +- **Single-file publishing** with all dependencies included +- **Multi-platform builds** (x64, x86, ARM64) +- **Automatic versioning** with timestamps +- **Artifact retention** (90 days) +- **Release automation** with detailed descriptions +- **File size reporting** in build logs + +### ?? **Configuration** +The workflows use these publish settings: +```xml +PublishSingleFile=true +IncludeNativeLibrariesForSelfExtract=true +IncludeAllContentForSelfExtract=true +WindowsAppSDKSelfContained=true +EnableCompressionInSingleFile=true +PublishTrimmed=false +SatelliteResourceLanguages=en +``` + +## ?? Prerequisites + +### Repository Setup +1. Ensure your repository has the correct project structure +2. The workflows expect: + - Project path: `Windows Desktop Script UI/Windows Desktop Script UI.csproj` + - .NET 8.0 target framework + - Windows App SDK package references + +### GitHub Permissions +The workflows require: +- **Contents**: write (for creating releases) +- **Actions**: write (for uploading artifacts) + +## ?? Usage Examples + +### Example 1: Quick Development Release +```bash +# Push your changes +git add . +git commit -m "Add new features" +git push origin main + +# Artifacts will be automatically created +# Download from GitHub Actions tab +``` + +### Example 2: Tagged Release +```bash +# Go to GitHub Actions ? Quick Release +# Enter: v1.0.0 +# Run workflow +# Release will be created automatically +``` + +### Example 3: Pre-release Testing +```bash +# Go to GitHub Actions ? Quick Release +# Enter: v1.0.0-beta +# Check "Mark as pre-release" +# Run workflow +``` + +## ?? Customization + +### Modify Build Platforms +Edit `.github/workflows/build-and-publish.yml`: +```yaml +strategy: + matrix: + platform: [x64] # Remove x86, ARM64 if not needed +``` + +### Change Trigger Branches +```yaml +on: + push: + branches: [ main, develop, your-branch ] +``` + +### Modify Retention Period +```yaml +- name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + retention-days: 30 # Change from 90 to 30 days +``` + +## ?? Monitoring Builds + +### Check Build Status +1. Go to your repository +2. Click **Actions** tab +3. See all workflow runs and their status + +### Download Artifacts +1. Click on a completed workflow run +2. Scroll to **Artifacts** section +3. Download the platform-specific build + +### View Build Logs +1. Click on a workflow run +2. Click on a job (e.g., "build-and-publish (x64)") +3. Expand steps to see detailed logs + +## ??? Troubleshooting + +### Common Issues + +**Build fails with platform error:** +- Ensure you're pushing to the correct branch +- Check that the project file supports the target platform + +**Missing artifacts:** +- Check build logs for errors +- Verify the executable was created in the publish step + +**Release not created:** +- Ensure you have write permissions to the repository +- Check that the workflow has `GITHUB_TOKEN` permissions + +### Getting Help +- Check the **Actions** tab for detailed error messages +- Review the build logs for specific error details +- Ensure all prerequisites are met + +## ?? Ready to Deploy! + +Your GitHub Actions are now set up! Every push will trigger a build, and you can create releases with a simple workflow dispatch. Your users can download single-file executables that run on any Windows 10/11 machine without requiring .NET installation. + +**Next Steps:** +1. Push this setup to your repository +2. Go to Actions and run "Quick Release" to create your first automated release +3. Share the download links with your users! \ No newline at end of file diff --git a/Windows Desktop Script UI/MainWindow.xaml.cs b/Windows Desktop Script UI/MainWindow.xaml.cs index bacb7a1..9af114a 100644 --- a/Windows Desktop Script UI/MainWindow.xaml.cs +++ b/Windows Desktop Script UI/MainWindow.xaml.cs @@ -344,6 +344,32 @@ private void ExecuteCommand(string commandStr) { LoaderText.Text = ""; } + + if(command.hasOption("Type")) + { + if(command.getOption("Type") == "Determinate") + { + Loader.IsIndeterminate = false; + + if (command.hasOption("Value")) + { + double progressValue = Convert.ToDouble(command.getOption("Value")); + if (progressValue >= 0 && progressValue <= 100) + { + Loader.Value = progressValue; + + if (command.hasOption("ShowPercentage")) + { + LoaderText.Text += " (" + progressValue.ToString() + "%)"; + } + } + } + } + else + { + Loader.IsIndeterminate = true; + } + } } Log.Write("Load [Hide: " + command.hasFlag("Hide") + "]");