diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e89238f..4ee7190e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,60 +1,55 @@ -name: Comprehensive CI -permissions: - contents: read +name: CI on: push: - branches: [ main, master, develop ] - tags: - - 'v*' + branches: ["**"] pull_request: - branches: [ main, master, develop ] - workflow_dispatch: jobs: build-windows: - name: Build (${{ matrix.configuration }}) + name: Windows build (${{ matrix.configuration }}) runs-on: windows-latest strategy: fail-fast: false matrix: - configuration: [ Debug, Release, Beta ] - env: - SOLUTION_FILE: srchybrid/emule.sln - BUILD_PLATFORM: Win32 + configuration: [Debug, Release] steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - fetch-depth: 0 - - name: Set up MSBuild + - name: Setup 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: Install Windows 10 SDK 10.0.22621.0 + shell: pwsh + run: choco install windows-sdk-10-version-22621-all --yes --no-progress - - name: Restore NuGet packages - working-directory: ${{ github.workspace }}/srchybrid - run: nuget restore emule.sln + - name: Install MFC components + shell: pwsh + run: | + $vsWhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" - - 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 + $vsPath = & $vsWhere -latest -prerelease -products * -property installationPath + if (-not $vsPath) { + throw 'Unable to locate a Visual Studio installation on the runner.' + } - - 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 + $hasMfc = & $vsWhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.ATLMFC -property installationPath + if ($hasMfc) { + Write-Host "MFC component already installed for Visual Studio at $hasMfc." + return + } + + $installerPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" + if (-not (Test-Path $installerPath)) { + throw "Visual Studio installer not found at expected path: $installerPath" + } + + &"$installerPath" modify --installPath "$vsPath" --add Microsoft.VisualStudio.Component.VC.ATLMFC --quiet --norestart --nocache + + - name: Build solution + working-directory: ${{ github.workspace }}\srchybrid + run: msbuild emule.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=Win32 /m diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..c57b8363 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,23 @@ +# Agent Instructions +- Keep GitHub Actions workflows readable with descriptive step names and avoid removing existing matrix configurations without discussion. +- Prefer minimal, focused changes that preserve the current build targets unless broader refactors are required. +- When updating dependency installation steps, include guards to skip work if the dependency is already present. + +## Project context +- This repository hosts the eMule Morph Windows client; the primary solution lives at `srchybrid/emule.sln` and targets Win32 Debug/Release configurations. +- The build depends on Visual Studio components such as the Windows 10 SDK (10.0.22621.0) and ATLMFC; prefer detecting existing installations before adding new ones. +- Submodules provide bundled third-party libraries (e.g., `cryptopp`, `pupnp`, `pthreads`); ensure they are initialized when workflows or build scripts need them. +- Source lives primarily in `srchybrid/` (MFC/ATL C++ with resources under `srchybrid/res/`), while third-party libraries are kept at the repository root for static linkage. +- Legacy build notes are in `How-To-Compile.txt`; keep guidance aligned with the current Visual Studio toolset and SDK expectations reflected in CI. + +## Contribution preferences +- Preserve the existing solution structure and Win32 platform unless there is a strong reason to broaden platform coverage. +- When changing CI or tooling, keep steps scoped to the minimal directories needed (for example, run Windows builds from `srchybrid/`). +- Align documentation and comments with the current build expectations, especially around SDK/MFC prerequisites. +- Prefer incremental adjustments that respect the original MorphXT code style (MFC message maps, `stdafx.*`, `.rc` resource organization) and avoid sweeping refactors. + +## Build and testing guidance +- Use `git submodule update --init --recursive` before building locally or in automation that starts from a fresh checkout. +- For MSBuild invocations, use `/p:Platform=Win32` and respect both Debug and Release configurations to mirror CI coverage. +- Prefer fast, targeted checks over long-running suites, and document any required environment setup (e.g., specific SDK or MFC components) in workflow steps or accompanying notes. +- When editing project files (`*.vcxproj`, `.sln`), keep the WindowsTargetPlatformVersion in sync with the CI-installed SDK to avoid mismatches.