diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 000000000..6a83a24c2 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,35 @@ +name: "CodeQL Config for eMule MorphXT" + +# Paths to include in analysis +paths: + - srchybrid + - cryptopp + - ResizableLib + - ReplaceVistaIcon + +# Paths to exclude from analysis +paths-ignore: + - "**/build/**" + - "**/Debug*/**" + - "**/Release*/**" + - "**/obj/**" + - "**/out/**" + - "**/external/**" + - "srchybrid/lang" + - "srchybrid/res" + +# Disable default queries to use custom ones +disable-default-queries: false + +# Additional queries to run +queries: + - uses: security-and-quality + - uses: security-extended + +# Query filters +query-filters: + - exclude: + id: cpp/poorly-documented-function + - exclude: + id: cpp/fixme-comment + diff --git a/.github/workflows/build-emule.yml b/.github/workflows/build-emule.yml new file mode 100644 index 000000000..5ba0271aa --- /dev/null +++ b/.github/workflows/build-emule.yml @@ -0,0 +1,167 @@ +name: Build and Test + +on: + push: + branches: [main, master, develop] + pull_request: + branches: [main, master, develop] + workflow_dispatch: + +env: + SOLUTION_FILE_PATH: srchybrid/emule.sln + BUILD_CONFIGURATION: Release + BUILD_OUTPUT_ROOT: srchybrid/build + +jobs: + build: + strategy: + matrix: + platform: [Win32] + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + submodules: recursive + + - name: Setup MSBuild and Install MFC/ATL + uses: ./.github/actions/setup-msbuild-mfc + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/packages.config') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore NuGet packages + run: nuget restore "${{ env.SOLUTION_FILE_PATH }}" + + - name: Build Solution + run: | + # Note: TreatWarningsAsErrors not enabled to allow gradual warning cleanup + $outDir = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\${{ env.BUILD_CONFIGURATION }}\Binary\" + msbuild /m ` + /p:Configuration=${{ env.BUILD_CONFIGURATION }} ` + /p:Platform=${{ matrix.platform }} ` + /p:OutDir="$outDir" ` + "${{ env.SOLUTION_FILE_PATH }}" + + - name: Verify Build Output + shell: pwsh + run: | + $exePath = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\${{ env.BUILD_CONFIGURATION }}\Binary\emule.exe" + if (Test-Path $exePath) { + Write-Host "✓ Build successful: $exePath exists" + $fileInfo = Get-Item $exePath + Write-Host " Size: $($fileInfo.Length) bytes" + Write-Host " Modified: $($fileInfo.LastWriteTime)" + } else { + Write-Error "✗ Build failed: $exePath not found" + exit 1 + } + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: emule-${{ matrix.platform }}-${{ env.BUILD_CONFIGURATION }} + path: | + ${{ env.BUILD_OUTPUT_ROOT }}/${{ matrix.platform }}/${{ env.BUILD_CONFIGURATION }}/Binary/** + retention-days: 30 + if-no-files-found: warn + + build-debug: + strategy: + matrix: + platform: [Win32] + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + submodules: recursive + + - name: Setup MSBuild + shell: pwsh + run: | + # Find Visual Studio installation using vswhere (pre-installed on windows-latest) + $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest ` + -products * ` + -requires Microsoft.Component.MSBuild ` + -property installationPath + + if ($vsPath) { + Write-Host "Found Visual Studio at: $vsPath" + + # Add MSBuild to PATH + $msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin" + if (Test-Path $msbuildPath) { + Write-Host "Adding MSBuild to PATH: $msbuildPath" + echo "$msbuildPath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + } + + # Add vswhere location to PATH for consistency + $vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer" + echo "$vswherePath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + + # Persist the install path for later steps + echo "VS_INSTALL_PATH=$vsPath" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 + } else { + Write-Error "Visual Studio installation not found!" + exit 1 + } + + - name: Install MFC and ATL components + shell: pwsh + run: | + $vsInstallPath = $env:VS_INSTALL_PATH + if (-not $vsInstallPath) { + throw "Visual Studio install path was not exported from the setup step." + } + $installer = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" + if (-not (Test-Path $installer)) { + throw "Visual Studio installer not found at $installer." + } + & $installer modify ` + --installPath $vsInstallPath ` + --add Microsoft.VisualStudio.Component.VC.ATLMFC ` + --quiet --wait + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/packages.config') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore NuGet packages + working-directory: ${{ github.workspace }} + run: nuget restore "${{ env.SOLUTION_FILE_PATH }}" + + - name: Build Debug Configuration + working-directory: ${{ github.workspace }} + run: | + $outDir = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\Debug\Binary\" + msbuild /m ` + /p:Configuration=Debug ` + /p:Platform=${{ matrix.platform }} ` + /p:OutDir="$outDir" ` + "${{ env.SOLUTION_FILE_PATH }}" + + - name: Verify Debug Build Output + shell: pwsh + run: | + $exePath = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\Debug\Binary\emule.exe" + if (Test-Path $exePath) { + Write-Host "✓ Debug build successful: $exePath exists" + $fileInfo = Get-Item $exePath + Write-Host " Size: $($fileInfo.Length) bytes" + Write-Host " Modified: $($fileInfo.LastWriteTime)" + } else { + Write-Error "✗ Debug build failed: $exePath not found" + exit 1 + } diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 000000000..710b85258 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,170 @@ +name: Code Quality + +on: + push: + branches: [main, master, develop] + pull_request: + branches: [main, master, develop] + workflow_dispatch: + +env: + SOLUTION_FILE_PATH: srchybrid/emule.sln + +jobs: + static-analysis: + name: Static Analysis + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + submodules: recursive + + - name: Setup MSBuild + shell: pwsh + run: | + # Locate the latest Visual Studio installation that includes MSBuild. + $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest ` + -products * ` + -requires Microsoft.Component.MSBuild ` + -property installationPath + + if ($vsPath) { + Write-Host "Found Visual Studio at: $vsPath" + + # Add MSBuild to PATH for subsequent steps. + $msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin" + if (Test-Path $msbuildPath) { + Write-Host "Adding MSBuild to PATH: $msbuildPath" + echo "$msbuildPath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + } + + # Persist installer paths for later steps. + $vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer" + echo "$vswherePath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + echo "VS_INSTALL_PATH=$vsPath" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 + } else { + Write-Error "Visual Studio installation not found!" + exit 1 + } + + - name: Install MFC and ATL components + shell: pwsh + run: | + $vsInstallPath = $env:VS_INSTALL_PATH + if (-not $vsInstallPath) { + throw "Visual Studio install path was not exported from the setup step." + } + $installer = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" + if (-not (Test-Path $installer)) { + throw "Visual Studio installer not found at $installer." + } + & $installer modify ` + --installPath $vsInstallPath ` + --add Microsoft.VisualStudio.Component.VC.ATLMFC ` + --quiet --wait + + - name: Restore NuGet packages + run: nuget restore "${{ env.SOLUTION_FILE_PATH }}" + + - name: Run Code Analysis + shell: pwsh + run: | + $outDir = Join-Path "srchybrid/build" "Win32/Release/CodeAnalysis/" + msbuild /m ` + /p:Configuration=Release ` + /p:Platform=Win32 ` + /p:RunCodeAnalysis=true ` + /p:CodeAnalysisRuleSet=NativeRecommendedRules.ruleset ` + /p:OutDir="$outDir" ` + "${{ env.SOLUTION_FILE_PATH }}" + continue-on-error: true + + - name: Upload Analysis Results + uses: actions/upload-artifact@v4 + if: always() + with: + name: code-analysis-results + path: | + **/*.nativecodeanalysis.xml + retention-days: 7 + + lint-check: + name: Format Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install clang-format + run: | + sudo apt-get update + sudo apt-get install -y clang-format + + - name: Check formatting (dry-run) + run: | + find srchybrid -type f \( -name "*.cpp" -o -name "*.h" \) | while read -r file; do + clang-format --dry-run --Werror "$file" 2>&1 | tee -a format-errors.txt || true + done + continue-on-error: true + + - name: Show formatting issues + if: always() + run: | + if [ -f format-errors.txt ]; then + echo "Formatting issues found:" + cat format-errors.txt + else + echo "No formatting issues found" + fi + + documentation-check: + name: Documentation Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Check for README updates + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + BASE="${{ github.event.pull_request.base.sha }}" + HEAD="${{ github.event.pull_request.head.sha }}" + else + BASE="${{ github.event.before }}" + HEAD="${{ github.sha }}" + fi + + if [ -z "$BASE" ]; then + echo "::notice::Unable to determine base revision for README comparison." + else + git fetch origin "$BASE" --depth=1 || true + CHANGED=$(git diff --name-only "$BASE" "$HEAD" || true) + if ! echo "$CHANGED" | grep -qi "readme.md"; then + echo "::notice::No README updates in this change." + fi + fi + + - name: Check for broken links in markdown + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'no' + continue-on-error: true + + dependency-check: + name: Dependency Review + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Dependency Review + uses: actions/dependency-review-action@v4 + with: + fail-on-severity: moderate + continue-on-error: true + diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8dfed3bf1..1d1e9b0cc 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,114 +1,103 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" +name: "CodeQL Security Scan" on: push: - branches: [ "main", "legacy" ] + branches: [main, master, develop] pull_request: - branches: [ "main", "legacy" ] + branches: [main, master, develop] schedule: - - cron: '32 6 * * 4' + - cron: '0 0 * * 1' + workflow_dispatch: + +env: + SOLUTION_FILE_PATH: srchybrid/emule.sln jobs: analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'windows-latest' }} + name: Analyze C++ + runs-on: windows-latest + timeout-minutes: 360 + permissions: - # required for all workflows security-events: write - - # required to fetch internal or private CodeQL packs packages: read - - # only required for workflows in private repositories actions: read contents: read - strategy: - fail-fast: false - matrix: - include: - - language: c-cpp - build-mode: manual - # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + submodules: recursive + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: cpp + config-file: ./.github/codeql/codeql-config.yml + queries: +security-and-quality + + - name: Setup MSBuild + shell: pwsh + run: | + # Locate the latest Visual Studio installation that includes MSBuild. + $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest ` + -products * ` + -requires Microsoft.Component.MSBuild ` + -property installationPath + + if ($vsPath) { + Write-Host "Found Visual Studio at: $vsPath" - # Add any setup steps before running the `github/codeql-action/init` action. - # This includes steps like installing compilers or runtimes (`actions/setup-node` - # or others). This is typically only required for manual builds. - # - name: Setup runtime (example) - # uses: actions/setup-example@v1 + # Add MSBuild to PATH for subsequent steps. + $msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin" + if (Test-Path $msbuildPath) { + Write-Host "Adding MSBuild to PATH: $msbuildPath" + echo "$msbuildPath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + } - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # Persist installer paths for later steps. + $vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer" + echo "$vswherePath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + echo "VS_INSTALL_PATH=$vsPath" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 + } else { + Write-Error "Visual Studio installation not found!" + exit 1 + } - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + - name: Install MFC and ATL components + shell: pwsh + run: | + $vsInstallPath = $env:VS_INSTALL_PATH + if (-not $vsInstallPath) { + throw "Visual Studio install path was not exported from the setup step." + } + $installer = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" + if (-not (Test-Path $installer)) { + throw "Visual Studio installer not found at $installer." + } + & $installer modify ` + --installPath $vsInstallPath ` + --add Microsoft.VisualStudio.Component.VC.ATLMFC ` + --quiet --wait - # Setup MSBuild for manual build mode - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 + - name: Restore NuGet packages + run: nuget restore "${{ env.SOLUTION_FILE_PATH }}" - # Install MFC and ATL components required by the project - - name: Install Visual Studio components (MFC, ATL) - shell: powershell - run: | - # Get Visual Studio installation path - $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath - Write-Host "Visual Studio installation path: $vsPath" - - # Install MFC and ATL components separately - & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify --installPath "$vsPath" --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.ATLMFC --quiet --wait - - Write-Host "MFC and ATL components installation completed" + - name: Build with MSBuild + shell: pwsh + run: | + $outDir = Join-Path "srchybrid/build" "Win32/Release/CodeQL/" + msbuild /m ` + /p:Configuration=Release ` + /p:Platform=Win32 ` + /p:OutDir="$outDir" ` + "${{ env.SOLUTION_FILE_PATH }}" - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - name: Build with MSBuild - if: matrix.build-mode == 'manual' - shell: cmd - run: | - echo Building eMule solution with all dependencies... - msbuild srchybrid\emule.sln /t:Rebuild /p:Configuration=Release /p:Platform=Win32 /m + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:cpp" - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..af7f6765a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,175 @@ +name: Release Build + +on: + release: + types: [created, published] + workflow_dispatch: + inputs: + version: + description: 'Version number (e.g., 1.0.0.0)' + required: true + default: '1.0.0.0' + +env: + SOLUTION_FILE_PATH: srchybrid/emule.sln + BUILD_OUTPUT_ROOT: srchybrid/build + +jobs: + build-release: + name: Build Release (${{ matrix.platform }}) + runs-on: windows-latest + strategy: + matrix: + platform: [Win32] + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + submodules: recursive + + - name: Setup MSBuild + shell: pwsh + run: | + # Locate the latest Visual Studio installation that includes MSBuild. + $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest ` + -products * ` + -requires Microsoft.Component.MSBuild ` + -property installationPath + + if ($vsPath) { + Write-Host "Found Visual Studio at: $vsPath" + + # Add MSBuild to PATH for subsequent steps. + $msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin" + if (Test-Path $msbuildPath) { + Write-Host "Adding MSBuild to PATH: $msbuildPath" + echo "$msbuildPath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + } + + # Persist installer paths for later steps. + $vswherePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer" + echo "$vswherePath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + echo "VS_INSTALL_PATH=$vsPath" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 + } else { + Write-Error "Visual Studio installation not found!" + exit 1 + } + + - name: Install MFC and ATL components + shell: pwsh + run: | + $vsInstallPath = $env:VS_INSTALL_PATH + if (-not $vsInstallPath) { + throw "Visual Studio install path was not exported from the setup step." + } + $installer = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" + if (-not (Test-Path $installer)) { + throw "Visual Studio installer not found at $installer." + } + & $installer modify ` + --installPath $vsInstallPath ` + --add Microsoft.VisualStudio.Component.VC.ATLMFC ` + --quiet --wait + + - name: Restore NuGet packages + run: nuget restore "${{ env.SOLUTION_FILE_PATH }}" + + - name: Build Release + shell: pwsh + run: | + $outDir = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\Release\Binary\" + msbuild /m ` + /p:Configuration=Release ` + /p:Platform=${{ matrix.platform }} ` + /p:OutDir="$outDir" ` + "${{ env.SOLUTION_FILE_PATH }}" + + - name: Verify Release Binaries + shell: pwsh + run: | + $exePath = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\Release\Binary\emule.exe" + if (Test-Path $exePath) { + Write-Host "✓ Release build successful: $exePath" + $info = Get-Item $exePath + Write-Host " Size: $($info.Length) bytes" + Write-Host " Modified: $($info.LastWriteTime)" + } else { + Write-Error "✗ Release build failed: $exePath not found" + exit 1 + } + + - name: Package Release + shell: pwsh + run: | + $artifactRoot = "emule-${{ matrix.platform }}-release" + $binarySource = Join-Path "${{ env.BUILD_OUTPUT_ROOT }}" "${{ matrix.platform }}\Release\Binary" + New-Item -ItemType Directory -Force -Path $artifactRoot | Out-Null + Copy-Item -Path (Join-Path $binarySource "*") -Destination (Join-Path $artifactRoot "Binary") -Recurse -Force + Copy-Item -Path "srchybrid\lang" -Destination (Join-Path $artifactRoot "lang") -Recurse -ErrorAction SilentlyContinue + Copy-Item -Path "emule\config" -Destination (Join-Path $artifactRoot "config") -Recurse -ErrorAction SilentlyContinue + Copy-Item -Path "emule\webserver" -Destination (Join-Path $artifactRoot "webserver") -Recurse -ErrorAction SilentlyContinue + Copy-Item -Path "emule\wapserver" -Destination (Join-Path $artifactRoot "wapserver") -Recurse -ErrorAction SilentlyContinue + Copy-Item -Path "Readme.md" -Destination $artifactRoot -ErrorAction SilentlyContinue + Copy-Item -Path "emule\license.txt" -Destination $artifactRoot -ErrorAction SilentlyContinue + $version = if ("${{ github.event.inputs.version }}") { "${{ github.event.inputs.version }}" } else { "${{ github.ref_name }}" } + @" +eMule MorphXT +Version: $version +Platform: ${{ matrix.platform }} +Build Date: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss") +Commit: ${{ github.sha }} +"@ | Out-File -FilePath (Join-Path $artifactRoot "VERSION.txt") -Encoding utf8 + + - name: Create ZIP archive + shell: pwsh + run: | + $version = if ("${{ github.event.inputs.version }}") { "${{ github.event.inputs.version }}" } else { "${{ github.ref_name }}" } + $zipName = "emule-${{ matrix.platform }}-$version.zip" + Compress-Archive -Path "emule-${{ matrix.platform }}-release\*" -DestinationPath $zipName -Force + + - name: Upload Release Artifact + uses: actions/upload-artifact@v4 + with: + name: emule-${{ matrix.platform }}-release + path: emule-${{ matrix.platform }}-*.zip + retention-days: 90 + + - name: Upload to Release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: emule-${{ matrix.platform }}-*.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + create-installer: + name: Create Installer + needs: build-release + runs-on: windows-latest + if: github.event_name == 'release' + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Download Win32 artifacts + uses: actions/download-artifact@v6 + with: + name: emule-Win32-release + path: ./artifacts/Win32 + + - name: Download x64 artifacts + uses: actions/download-artifact@v6 + with: + name: emule-x64-release + path: ./artifacts/x64 + + - name: Create installer + shell: pwsh + run: | + # Placeholder for installer creation using a tool such as NSIS, WiX, or InnoSetup. + Write-Host "Installer creation step is not yet implemented." + +# The "Upload Installer" step has been removed until installer creation is implemented. + diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..6409ec325 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,44 @@ +name: Mark Stale Issues and PRs + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v10 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: | + This issue has been automatically marked as stale because it has not had recent activity. + It will be closed if no further activity occurs within 7 days. + If this issue is still relevant, please comment to keep it open. + close-issue-message: | + This issue has been automatically closed due to inactivity. + If you believe this issue is still relevant, please reopen it or create a new issue with updated information. + days-before-issue-stale: 90 + days-before-issue-close: 7 + stale-issue-label: 'stale' + exempt-issue-labels: 'pinned,security,bug,enhancement,good-first-issue' + stale-pr-message: | + This pull request has been automatically marked as stale because it has not had recent activity. + It will be closed if no further activity occurs within 14 days. + If this PR is still relevant, please comment or push new commits to keep it open. + close-pr-message: | + This pull request has been automatically closed due to inactivity. + If you would like to continue this work, please reopen the PR or create a new one. + days-before-pr-stale: 60 + days-before-pr-close: 14 + stale-pr-label: 'stale' + exempt-pr-labels: 'pinned,security,work-in-progress' + operations-per-run: 100 + ascending: true + exempt-all-assignees: true + remove-stale-when-updated: true + diff --git a/ReplaceVistaIcon/ReplaceVistaIcon.vcxproj b/ReplaceVistaIcon/ReplaceVistaIcon.vcxproj index ea6655629..e4bbfffd5 100644 --- a/ReplaceVistaIcon/ReplaceVistaIcon.vcxproj +++ b/ReplaceVistaIcon/ReplaceVistaIcon.vcxproj @@ -21,12 +21,12 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 @@ -65,6 +65,8 @@ Use Level3 EditAndContinue + Default + Default $(OutDir)ReplaceVistaIcon.exe @@ -84,6 +86,8 @@ Use Level3 ProgramDatabase + Default + Default $(OutDir)ReplaceVistaIcon.exe diff --git a/ResizableLib/ResizableLib.vcxproj b/ResizableLib/ResizableLib.vcxproj index c3920dd93..d8c67776d 100644 --- a/ResizableLib/ResizableLib.vcxproj +++ b/ResizableLib/ResizableLib.vcxproj @@ -21,13 +21,13 @@ StaticLibrary Static Unicode - v142 + v143 StaticLibrary Static Unicode - v142 + v143 @@ -75,6 +75,8 @@ true true true + Default + Default _AFXDLL;NDEBUG;%(PreprocessorDefinitions) @@ -101,6 +103,8 @@ Level4 true ProgramDatabase + Default + Default _AFXDLL;_DEBUG;%(PreprocessorDefinitions) diff --git a/srchybrid/CxImage/cximage.vcxproj b/srchybrid/CxImage/cximage.vcxproj index 0000eb9ef..28f64b970 100644 --- a/srchybrid/CxImage/cximage.vcxproj +++ b/srchybrid/CxImage/cximage.vcxproj @@ -21,13 +21,13 @@ StaticLibrary Static Unicode - v142 + v143 StaticLibrary Static Unicode - v142 + v143 @@ -75,6 +75,8 @@ Level3 Default true + Default + Default _AFXDLL;NDEBUG;%(PreprocessorDefinitions) @@ -102,6 +104,8 @@ Level3 ProgramDatabase Default + Default + Default _DEBUG;%(PreprocessorDefinitions) diff --git a/srchybrid/emule.vcxproj b/srchybrid/emule.vcxproj index 0a5934970..da66376d5 100644 --- a/srchybrid/emule.vcxproj +++ b/srchybrid/emule.vcxproj @@ -27,7 +27,7 @@ Static Unicode true - v142 + v143 Application @@ -35,13 +35,13 @@ false Unicode true - v142 + v143 Application Static Unicode - v142 + v143 @@ -109,6 +109,8 @@ Use Level4 ProgramDatabase + Default + Default _DEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions) @@ -166,6 +168,8 @@ Level3 ProgramDatabase + Default + Default NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)