Skip to content
Open
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.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Comprehensive CI
permissions:
contents: read

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

jobs:
build-windows:
name: Build (${{ matrix.configuration }})
Comment on lines +15 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.

suggestion (performance): The CI workflow overlaps with the dedicated debug/release workflows, which may cause redundant builds.

This can trigger 2–3 workflows per push/PR that all run the same Debug/Release builds, increasing queue times and CI resource usage. Consider either restricting when the debug/release workflows run (e.g., manual-only) or merging them into this workflow as separate jobs to avoid duplication.

Suggested implementation:

  build-windows:
    name: Build Beta

      matrix:
        configuration: [ Beta ]

To fully implement your suggestion and avoid redundant Debug/Release builds:

  1. Update or remove the dedicated Debug/Release workflows so that they either:
    • Run only manually (via workflow_dispatch), or
    • Are deleted/disabled once this CI workflow takes over all required build variants.
  2. If you want this CI workflow to become the single source of truth for all configurations, you can:
    • Reintroduce Debug/Release as separate jobs (e.g., build-windows-debug, build-windows-release) in this same ci.yml file.
    • Then delete or disable the separate debug/release workflow files to prevent duplication.
  3. Make sure branch/tag filters and triggers (on: section) are aligned across workflows so that only one workflow handles each Debug/Release/Beta scenario.

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [ Debug, Release, Beta ]
env:
SOLUTION_FILE: srchybrid/emule.sln
BUILD_PLATFORM: Win32

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

- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2

- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}
restore-keys: ${{ runner.os }}-nuget-

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

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

- name: Upload ${{ matrix.configuration }} artifacts
uses: actions/upload-artifact@v4
with:
name: emule-${{ matrix.configuration }}-${{ github.run_number }}
path: |
srchybrid/${{ matrix.configuration }}/*.exe
srchybrid/${{ matrix.configuration }}/*.dll
srchybrid/${{ matrix.configuration }}/*.pdb
if-no-files-found: warn
Comment thread Fixed
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

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 +15 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.

🚨 suggestion (security): Consider limiting contents: write permissions to only the paths/events that actually need it for releases.

Currently this job has contents: write on all runs, even though only the tag-based release step needs to write. To follow least-privilege practices, consider moving the release creation to a separate job that runs only on tag pushes with contents: write, and keep this main job at contents: read.

Suggested implementation:

jobs:
  build:
    runs-on: windows-latest

  release:
    name: Create Release
    needs: build
    if: startsWith(github.ref, 'refs/tags/v')
    permissions:
      contents: write
    runs-on: windows-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          generate_release_notes: true

To fully implement the suggestion you should also:

  1. Ensure the workflow-level permissions are set to contents: read (which you already added with permissions: contents: read) and that the build job does NOT override this with broader permissions anywhere else in the file.
  2. Move any existing release-creation steps (e.g., calls to softprops/action-gh-release or similar) out of the build job into the new release job so that only the release job actually writes to contents.
  3. Confirm that the workflow on: section is defined only once at the top level (the snippet shows repeated on: / jobs: blocks; in the final file you should have a single on: block and a single jobs: block containing both build and release jobs).


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
Comment on lines +27 to +29

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (performance): NuGet restore in the release workflow could benefit from the same caching strategy as CI to speed up builds.

The release workflow restores NuGet packages without using actions/cache, which makes releases slower and more prone to network issues. Please mirror the cache configuration from ci.yml (same actions/cache step, key, and path) so release builds benefit from the same caching behavior.


- 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 }
Comment on lines +44 to +48

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 Release workflow reads artifacts from nonexistent folder

The release workflow gathers files from srchybrid/Release, but the solution writes its Release binaries to build/Win32/Binary (see srchybrid/emule.vcxproj lines 65-69 where OutDir points to $(SolutionDir)\build\$(Platform)\Binary\). On a tag push the Get-ChildItem -Path "srchybrid/Release" command will fail because that directory is never produced, so the release job cannot attach any assets.

Useful? React with 👍 / 👎.

# 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 }}
draft: false
prerelease: false
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
**/*Release*/*
srchybrid/build/*
*.user
IUpnp*.txt
IUpnp*.txt
wiki/
10 changes: 5 additions & 5 deletions ReplaceVistaIcon/ReplaceVistaIcon.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand All @@ -15,18 +15,18 @@
<RootNamespace>ReplaceVistaIcon</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>ReplaceVistaIcon</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -113,4 +113,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
10 changes: 5 additions & 5 deletions ResizableLib/ResizableLib.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand All @@ -14,20 +14,20 @@
<ProjectGuid>{A5743026-DE7A-4C3D-86EA-46D6B6847F14}</ProjectGuid>
<Keyword>MFCProj</Keyword>
<ProjectName>ResizableLib</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -171,4 +171,4 @@
<UserProperties DevPartner_IsInstrumented="0" />
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>
10 changes: 5 additions & 5 deletions srchybrid/CxImage/cximage.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand All @@ -14,20 +14,20 @@
<ProjectGuid>{8FEC2660-7F95-4C2E-8747-36176E1FCF82}</ProjectGuid>
<Keyword>MFCProj</Keyword>
<ProjectName>cximage</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -429,4 +429,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
12 changes: 6 additions & 6 deletions srchybrid/emule.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Beta|Win32">
Expand All @@ -19,29 +19,29 @@
<RootNamespace>emule</RootNamespace>
<Keyword>MFCProj</Keyword>
<ProjectName>emule</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Beta|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -1296,4 +1296,4 @@ del $(IntDir)emule.obj
<UserProperties RESOURCE_FILE="emule.rc" />
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>
Loading