Add Velopack Support with Github Action#42
Conversation
Removed references to `icon.png` and `icon.icns` in the `Editor.Desktop.csproj` file. Added new binary files for `icon.icns` and `icon.png` to the project, likely as updated or replacement resources.
Added a package reference for Velopack in `Editor.Desktop.csproj` to include the library as a dependency. Updated `Program.cs` to import the Velopack namespace and modified the `Main` method to initialize and run `VelopackApp` early in the application startup process. This ensures proper setup of Velopack before other application logic.
Added `build-linux.sh` to automate the build process for Linux, including cleaning, publishing, and packaging with Velopack. Added `build-osx.sh` to automate the build process for macOS, with similar functionality as the Linux script. Added `build-win.bat` for Windows builds using a batch script, supporting publishing and packaging with Velopack. Added `build-win.sh` for Windows builds using a Bash script, providing an alternative to the batch script with additional cleanup functionality.
Added a new `release.yml` workflow to automate the build and release process. The workflow triggers on `push` events for tags matching `v*.*.*`. It includes a `build` job that runs on a matrix of OSes (`ubuntu-latest` and `macos-latest`), sets up the .NET SDK (v9.0.x), installs the `vpk` CLI, restores dependencies, and builds the project using platform-specific scripts. Artifacts are uploaded for each platform. Introduced a `release` job that runs on tag events, downloads artifacts, and creates a GitHub Release using the `softprops/action-gh-release@v2` action. This workflow streamlines the multi-platform build and release process.
There was a problem hiding this comment.
Pull Request Overview
This PR adds automated release packaging and distribution for the Editor.Desktop application using Velopack and GitHub Actions. The implementation includes cross-platform build scripts for Linux, macOS, and Windows, integrates Velopack SDK into the application startup, and creates a CI/CD workflow for automatic release creation when version tags are pushed.
Key changes:
- Velopack integration in application startup with early initialization
- Platform-specific build scripts automating compilation and package creation
- GitHub Actions workflow for automated multi-platform releases
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Editor.Desktop/Program.cs | Integrates Velopack initialization at application startup |
| Editor.Desktop/Editor.Desktop.csproj | Adds Velopack dependency and removes unused icon resources |
| Editor.Desktop/build-win.sh | Windows build script with Velopack packaging |
| Editor.Desktop/build-win.bat | Windows batch build script |
| Editor.Desktop/build-osx.sh | macOS build script with Velopack packaging |
| Editor.Desktop/build-linux.sh | Linux build script with Velopack packaging |
| Editor.Desktop/icon.png | New PNG icon resource for the application |
| Editor.Desktop/icon.icns | New macOS icon resource |
| .github/workflows/release.yml | GitHub Actions workflow for automated releases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| echo "" | ||
| echo "Building Velopack Release v$BUILD_VERSION" | ||
| vpk [win] pack --runtime win-x64 -u Editor.Desktop --packTitle "MathEditor" -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -e "Editor.Desktop.exe" -i "$ICON_PATH" |
There was a problem hiding this comment.
The syntax vpk [win] appears incorrect. Based on Velopack documentation, the command should be vpk pack without brackets around the platform. The [win] syntax is not valid for the Velopack CLI. This should be: vpk pack --runtime win-x64 ...
| vpk [win] pack --runtime win-x64 -u Editor.Desktop --packTitle "MathEditor" -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -e "Editor.Desktop.exe" -i "$ICON_PATH" | |
| vpk pack --runtime win-x64 -u Editor.Desktop --packTitle "MathEditor" -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -e "Editor.Desktop.exe" -i "$ICON_PATH" |
|
|
||
| echo "" | ||
| echo "Building Velopack Release v$BUILD_VERSION" | ||
| vpk [osx] pack -u Editor.Desktop --packTitle "MathEditor" -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -e "Editor.Desktop" -i "$ICON_PATH" |
There was a problem hiding this comment.
The syntax vpk [osx] appears incorrect. Based on Velopack documentation, the command should be vpk pack without brackets around the platform. The [osx] syntax is not valid for the Velopack CLI. This should be: vpk pack -u Editor.Desktop ...
| vpk [osx] pack -u Editor.Desktop --packTitle "MathEditor" -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -e "Editor.Desktop" -i "$ICON_PATH" | |
| vpk pack -u Editor.Desktop --packTitle "MathEditor" -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -e "Editor.Desktop" -i "$ICON_PATH" |
This pull request introduces automated release packaging and distribution for the
Editor.Desktopapplication using Velopack and GitHub Actions. It adds cross-platform build scripts, integrates Velopack into the build process, and sets up a workflow to create and publish releases for Linux, macOS, and Windows.Release automation and packaging:
.github/workflows/release.yml) to build the application on Linux and macOS, package it using Velopack, and automatically create GitHub Releases when a new version tag is pushed.Editor.Desktop.csprojand initializing it at application startup inProgram.cs. [1] [2] [3]Cross-platform build scripts:
build-linux.sh), macOS (build-osx.sh), and Windows (build-win.sh,build-win.bat) to compile the application, package it with Velopack, and handle versioning and icons. [1] [2] [3] [4]Resource management:
icon.png,icon.icns) from the Avalonia resource list.