Correct Arabic.json translations #79
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| paths: | |
| - 'src/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - 'src/**' | |
| workflow_dispatch: | |
| branches: [main, develop] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: windows-latest | |
| outputs: | |
| app_version: ${{ steps.version.outputs.app_version }} | |
| unsigned_artifact_name: winmemorycleaner-${{ steps.version.outputs.app_version }} | |
| test_artifact_name: ${{ steps.determine_artifact.outputs.name }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| nuget- | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore NuGet packages | |
| shell: pwsh | |
| run: nuget restore src\WinMemoryCleaner.sln | |
| - name: Build solution | |
| shell: pwsh | |
| run: msbuild src\WinMemoryCleaner.sln /m /p:Configuration=Release /p:Platform="Any CPU" | |
| - name: Get App Version | |
| id: version | |
| shell: pwsh | |
| run: | | |
| $assemblyInfoPath = "src/Properties/AssemblyInfo.cs" | |
| if (-Not (Test-Path $assemblyInfoPath)) { | |
| $assemblyInfoPath = "src/Properties/AssemblyInfo.cs" | |
| } | |
| if (-Not (Test-Path $assemblyInfoPath)) { | |
| Write-Host "::error::AssemblyInfo.cs not found" | |
| exit 1 | |
| } | |
| $assemblyInfo = Get-Content $assemblyInfoPath | |
| $versionLine = $assemblyInfo | Select-String -Pattern 'AssemblyVersion\("([0-9\.]+)"\)' | |
| if ($versionLine -match 'AssemblyVersion\("([0-9\.]+)"\)') { | |
| $fullVersion = $matches[1] | |
| if ($fullVersion -match '^(\d+\.\d+\.\d+)') { | |
| $appVersion = $matches[1] | |
| echo "app_version=$appVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
| } else { | |
| Write-Host "::error::Could not parse Major.Minor.Patch from version $fullVersion" | |
| exit 1 | |
| } | |
| } else { | |
| Write-Host "::error::Could not find version in $assemblyInfoPath" | |
| exit 1 | |
| } | |
| - name: Upload unsigned EXE as artifact | |
| id: upload-unsigned | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: winmemorycleaner-${{ steps.version.outputs.app_version }} | |
| path: src\bin\Release\WinMemoryCleaner.exe | |
| if-no-files-found: error | |
| - name: Submit to SignPath (Develop CI Signing) | |
| if: github.repository == 'IgorMundstein/WinMemoryCleaner' && github.ref == 'refs/heads/develop' | |
| id: signpath | |
| uses: signpath/github-action-submit-signing-request@v1.1 | |
| with: | |
| api-token: ${{ secrets.SIGNPATH_API_TOKEN }} | |
| organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }} | |
| project-slug: WinMemoryCleaner | |
| signing-policy-slug: ci-signing | |
| github-artifact-id: ${{ steps.upload-unsigned.outputs.artifact-id }} | |
| wait-for-completion: true | |
| output-artifact-directory: ./ | |
| - name: Upload signed build artifact | |
| if: steps.signpath.conclusion == 'success' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: winmemorycleaner-${{ steps.version.outputs.app_version }}-signed | |
| path: WinMemoryCleaner.exe | |
| retention-days: 30 | |
| - name: Determine Test Artifact | |
| id: determine_artifact | |
| shell: pwsh | |
| run: | | |
| if ('${{ steps.signpath.conclusion }}' -eq 'success') { | |
| echo "name=winmemorycleaner-${{ steps.version.outputs.app_version }}-signed" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
| } else { | |
| echo "name=winmemorycleaner-${{ steps.version.outputs.app_version }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
| } | |
| test-ui: | |
| name: UI Test on ${{ matrix.os }} | |
| needs: build-and-test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-2022, windows-2025] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Download build artifact for testing | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ needs.build-and-test.outputs.test_artifact_name }} | |
| - name: Run UI Test | |
| shell: pwsh | |
| run: | | |
| $appPath = ".\WinMemoryCleaner.exe" | |
| $appName = "WinMemoryCleaner" | |
| $screenshotPath = ".\screenshot-${{ matrix.os }}.png" | |
| Start-Process -FilePath $appPath | |
| Start-Sleep -Seconds 5 | |
| $process = Get-Process -Name $appName -ErrorAction SilentlyContinue | |
| if (-not $process) { | |
| Write-Host "::error::$appName process not found after starting." | |
| exit 1 | |
| } | |
| Add-Type -AssemblyName System.Windows.Forms | |
| $bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds | |
| $bitmap = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height | |
| $graphics = [System.Drawing.Graphics]::FromImage($bitmap) | |
| $graphics.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size) | |
| $bitmap.Save($screenshotPath, [System.Drawing.Imaging.ImageFormat]::Png) | |
| $graphics.Dispose() | |
| $bitmap.Dispose() | |
| Stop-Process -Name $appName -Force | |
| - name: Upload Screenshot Artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ui-test-screenshot-${{ matrix.os }} | |
| path: screenshot-${{ matrix.os }}.png | |
| retention-days: 1 | |
| package-screenshots: | |
| name: Package All Screenshots | |
| needs: [build-and-test, test-ui] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all screenshot artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: ui-test-screenshot-* | |
| path: ./all-screenshots | |
| merge-multiple: true | |
| - name: List final files for verification | |
| run: ls -R ./all-screenshots | |
| - name: Upload final screenshot package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: all-screenshots-${{ needs.build-and-test.outputs.app_version }} | |
| path: ./all-screenshots/ | |
| retention-days: 30 |