Add support for the Amiga CD32 Intro video #7
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: windows-build | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: x64 | |
| cmake_platform: x64 | |
| configuration: Release | |
| cmake_extra_args: "" | |
| vcpkg_triplet: x64-windows | |
| - arch: x86 | |
| cmake_platform: Win32 | |
| configuration: Release | |
| cmake_extra_args: -DWITH_ASM=OFF | |
| vcpkg_triplet: x86-windows | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install FFmpeg (vcpkg) | |
| shell: pwsh | |
| run: | | |
| $vcpkgRoot = "C:\vcpkg" | |
| if (-not (Test-Path $vcpkgRoot)) { | |
| git clone https://github.com/microsoft/vcpkg $vcpkgRoot | |
| } | |
| & "$vcpkgRoot\bootstrap-vcpkg.bat" | |
| Push-Location $env:GITHUB_WORKSPACE | |
| & "$vcpkgRoot\vcpkg.exe" install --triplet ${{ matrix.vcpkg_triplet }} | |
| Pop-Location | |
| - name: Cache CMake deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: Projects/VS/_deps | |
| key: ${{ runner.os }}-${{ matrix.arch }}-cmake-deps-${{ hashFiles('CMakeLists.txt') }} | |
| - name: Configure | |
| run: cmake -S . -B Projects/VS -G "Visual Studio 17 2022" -A ${{ matrix.cmake_platform }} ${{ matrix.cmake_extra_args }} -DOPENFODDER_ENABLE_FFMPEG=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} | |
| - name: Build | |
| run: cmake --build Projects/VS --config ${{ matrix.configuration }} | |
| - name: Test | |
| shell: pwsh | |
| run: | | |
| $runDir = "$env:GITHUB_WORKSPACE\Run" | |
| $dataRepo = "$runDir\_data_repo" | |
| $testsDir = "$runDir\Tests" | |
| New-Item -ItemType Directory -Path $runDir -Force | Out-Null | |
| if (Test-Path "$dataRepo\.git") { | |
| git -C $dataRepo pull | |
| } else { | |
| if (Test-Path $dataRepo) { Remove-Item $dataRepo -Recurse -Force } | |
| git clone --single-branch https://github.com/OpenFodder/data.git $dataRepo | |
| } | |
| if (Test-Path "$dataRepo\Data") { | |
| Copy-Item "$dataRepo\Data" "$runDir\Data" -Recurse -Force | |
| } else { | |
| Copy-Item "$dataRepo\*" $runDir -Recurse -Force -Exclude ".git" | |
| } | |
| if (Test-Path "$testsDir\.git") { | |
| git -C $testsDir pull | |
| } else { | |
| git clone https://github.com/OpenFodder/tests.git $testsDir | |
| } | |
| $ffmpegBin = "C:\vcpkg\installed\${{ matrix.vcpkg_triplet }}\bin" | |
| Copy-Item "$ffmpegBin\avcodec*.dll" -Destination $runDir -Force | |
| Copy-Item "$ffmpegBin\avformat*.dll" -Destination $runDir -Force | |
| Copy-Item "$ffmpegBin\avutil*.dll" -Destination $runDir -Force | |
| Copy-Item "$ffmpegBin\swscale*.dll" -Destination $runDir -Force | |
| Copy-Item "$ffmpegBin\swresample*.dll" -Destination $runDir -Force | |
| Push-Location $runDir | |
| .\openfodder.exe --appveyor --unit-test-headless | |
| Pop-Location | |
| - name: Package | |
| shell: pwsh | |
| run: | | |
| $archive = "OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest.zip" | |
| $ffmpegBin = "C:\vcpkg\installed\${{ matrix.vcpkg_triplet }}\bin" | |
| $ffmpegDlls = Get-ChildItem $ffmpegBin -Filter *.dll | Where-Object { | |
| $_.Name -match "^(avcodec|avformat|avutil|swscale|swresample)" | |
| } | Select-Object -ExpandProperty FullName | |
| $items = @( | |
| "$env:GITHUB_WORKSPACE\Run\openfodder.exe", | |
| "$env:GITHUB_WORKSPACE\Run\SDL3.dll", | |
| "$env:GITHUB_WORKSPACE\Run\SDL3_mixer.dll", | |
| "$env:GITHUB_WORKSPACE\README.md", | |
| "$env:GITHUB_WORKSPACE\COPYING", | |
| "$env:GITHUB_WORKSPACE\openfodder.ini.example" | |
| ) + $ffmpegDlls | |
| if (Test-Path $archive) { Remove-Item $archive -Force } | |
| Compress-Archive -Path $items -DestinationPath $archive | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| id: upload_artifact | |
| with: | |
| name: OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest | |
| path: OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest.zip | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.AWS_REGION || 'us-east-1' }} | |
| - name: Upload build zip to S3 | |
| shell: pwsh | |
| run: | | |
| $zipName = "OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest.zip" | |
| aws s3 cp "$zipName" "s3://openfodder-builds/$zipName" --acl public-read | |
| - name: Discord notification | |
| if: always() && env.DISCORD_WEBHOOK_URL != '' | |
| shell: pwsh | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: | | |
| $status = if ("${{ job.status }}" -eq "success") { "Success" } else { "Failure" } | |
| $color = if ("${{ job.status }}" -eq "success") { 3066993 } else { 15158332 } | |
| $title = "OpenFodder Windows build $status (${{ matrix.arch }})" | |
| $runUrl = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| $artifactUrl = "https://s3.amazonaws.com/openfodder-builds/OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest.zip" | |
| $commitMessage = "${{ github.event.head_commit.message }}" | |
| if (-not $commitMessage) { $commitMessage = "${{ github.event.pull_request.title }}" } | |
| if (-not $commitMessage) { $commitMessage = "N/A" } | |
| $payload = @{ | |
| username = "GitHub Actions" | |
| embeds = @( | |
| @{ | |
| title = $title | |
| url = $runUrl | |
| color = $color | |
| fields = @( | |
| @{ name = "Commit"; value = "${{ github.sha }}"; inline = $true } | |
| @{ name = "Branch"; value = "${{ github.ref_name }}"; inline = $true } | |
| @{ name = "Config"; value = "${{ matrix.configuration }}"; inline = $true } | |
| @{ name = "Commit Message"; value = $commitMessage; inline = $false } | |
| @{ name = "Download"; value = $artifactUrl; inline = $false } | |
| ) | |
| } | |
| ) | |
| } | ConvertTo-Json -Depth 5 | |
| Invoke-RestMethod -Method Post -Uri $env:DISCORD_WEBHOOK_URL -ContentType "application/json" -Body $payload |