Skip to content
Closed
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
55 changes: 55 additions & 0 deletions .github/agents/my-agent.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# Fill in the fields below to create a basic custom agent for your repository.
# The Copilot CLI can be used for local testing: https://gh.io/customagents/cli
# To make this agent available, merge this file into the default repository branch.
# For format details, see: https://gh.io/customagents/config

name: eMule Morph Build Agent
description: Specialized agent for building and managing the eMule Morph Windows C++ project
---

# eMule Morph Build Agent

This agent assists with building and managing the eMule Morph project, which is a Windows-based C++ application built with Visual Studio.

## Project Overview

eMule Morph is a peer-to-peer file sharing client based on eMule. This repository contains:
- Main emule application (Win32 C++ with MFC)
- Multiple dependency libraries (cryptlib, ResizableLib, zlib, libpng, cximage, id3lib, libupnp, pthread)
- Visual Studio solution files targeting Platform Toolset v142 (VS 2019)
- Git submodules for external dependencies

## Build Configurations

The project supports three build configurations:
- **Debug**: Development build with debug symbols
- **Release**: Optimized production build
- **Beta**: Pre-release build with optimizations

## Building the Project

To build the project locally:

1. Clone the repository with submodules:
```bash
git clone --recursive [repository-url]
```

2. Initialize submodules (if not cloned recursively):
```bash
git submodule init
git submodule update
```

3. Open `srchybrid/emule.sln` in Visual Studio 2019 or later

4. Select the desired configuration (Debug/Release/Beta) and build

## GitHub Actions

The repository includes CI/CD workflows that automatically build the project:
- Windows Debug build workflow
- Windows Release build workflow

These workflows ensure code quality and build integrity on every commit.
41 changes: 41 additions & 0 deletions .github/workflows/windows-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Windows Debug Build

on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
permissions:
contents: read
Comment thread
Mika3578 marked this conversation as resolved.

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Restore NuGet packages
working-directory: ${{github.workspace}}/srchybrid
run: nuget restore emule.sln

- name: Build Debug
working-directory: ${{github.workspace}}/srchybrid
run: msbuild emule.sln /p:Configuration=Debug /p:Platform=Win32 /m /v:minimal

- name: Upload Debug artifacts
uses: actions/upload-artifact@v4
with:
name: emule-debug-build-${{ github.run_number }}
path: |
srchybrid/Debug/*.exe
srchybrid/Debug/*.dll
srchybrid/Debug/*.pdb
if-no-files-found: warn
61 changes: 61 additions & 0 deletions .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Windows Release Build

on:
push:
branches: [ main, master, develop ]
tags:
- 'v*'
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
permissions:
contents: write
Comment on lines +13 to +16

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Grant actions permission for release artifact upload

This job restricts the GITHUB_TOKEN to contents: write only. The actions/upload-artifact@v4 step later in the job uses the actions API and will fail without actions: write (or actions: read) permission, so the Release workflow cannot complete successfully. Include the actions scope in the job permissions so artifact publishing works.

Useful? React with 👍 / 👎.


steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Restore NuGet packages
working-directory: ${{github.workspace}}/srchybrid
run: nuget restore emule.sln

- name: Build Release
working-directory: ${{github.workspace}}/srchybrid
run: msbuild emule.sln /p:Configuration=Release /p:Platform=Win32 /m /v:minimal

- name: Upload Release artifacts
uses: actions/upload-artifact@v4
with:
name: emule-release-build-${{ github.run_number }}
path: |
srchybrid/Release/*.exe
srchybrid/Release/*.dll
if-no-files-found: warn

- name: Get release files
id: get_release_files
shell: pwsh
run: |
$files = Get-ChildItem -Path "srchybrid/Release" -Include *.exe,*.dll -File | ForEach-Object { $_.FullName }

Copilot AI Nov 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Get-ChildItem command is missing the -Recurse parameter, which means it will only search the immediate srchybrid/Release directory. If any .exe or .dll files are in subdirectories, they won't be included in the release. Consider adding -Recurse if subdirectories should be searched, or verify that all release files are in the root Release directory.

Suggested change
$files = Get-ChildItem -Path "srchybrid/Release" -Include *.exe,*.dll -File | ForEach-Object { $_.FullName }
$files = Get-ChildItem -Path "srchybrid/Release" -Include *.exe,*.dll -File -Recurse | ForEach-Object { $_.FullName }

Copilot uses AI. Check for mistakes.
# Join with newline for multi-line YAML input
$filesString = $files -join "`n"
echo "release_files<<EOF" >> $env:GITHUB_OUTPUT
echo "$filesString" >> $env:GITHUB_OUTPUT
echo "EOF" >> $env:GITHUB_OUTPUT

- name: Create Release (on tag push)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.get_release_files.outputs.release_files }}
Comment on lines +44 to +59

Copilot AI Nov 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PowerShell script builds a multi-line string with file paths, but the softprops/action-gh-release@v1 action expects the files parameter to be a glob pattern or newline-separated list of file paths. The current approach using GITHUB_OUTPUT with multi-line strings should work, but there's a potential issue: the script outputs full paths (via $_.FullName), which will include the full GitHub workspace path. This will likely cause the action to fail because it won't find files at those absolute paths. Consider using relative paths instead by changing $_.FullName to $_.Name and prepending srchybrid/Release/ to each file, or use a simpler glob pattern directly in the release step like srchybrid/Release/*.exe and srchybrid/Release/*.dll.

Copilot uses AI. Check for mistakes.
draft: false
prerelease: false

Copilot AI Nov 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is missing the GITHUB_TOKEN environment variable or token parameter for the softprops/action-gh-release action. While it may inherit from the default token, it's better to explicitly pass it for clarity and to avoid potential permission issues. Add env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} or token: ${{ secrets.GITHUB_TOKEN }} to the action.

Suggested change
prerelease: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
Loading