Native Hooking API & Runtime d2d1 bezier patches #136
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: Build AffinityPluginLoader | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| # Cancel in-progress runs when a new workflow with the same group name is triggered | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Build the native C++ bootstrap DLL | |
| build-bootstrap: | |
| name: Build AffinityBootstrap (Native) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.client_payload.head_sha || github.sha }} | |
| repository: ${{ github.event.client_payload.head_repo || github.repository }} | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Setup MSVC Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Build AffinityBootstrap.dll | |
| working-directory: AffinityBootstrap | |
| run: | | |
| if not exist build mkdir build | |
| cl.exe /LD bootstrap.c ole32.lib oleaut32.lib mscoree.lib /Fe:build\AffinityBootstrap.dll /nologo | |
| del bootstrap.obj | |
| del build\AffinityBootstrap.exp | |
| del build\AffinityBootstrap.lib | |
| shell: cmd | |
| - name: Upload AffinityBootstrap artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AffinityBootstrap | |
| path: AffinityBootstrap/build/AffinityBootstrap.dll | |
| if-no-files-found: error | |
| # Build all C# projects (.NET Framework 4.8) | |
| build-csharp: | |
| name: Build C# Projects (.NET Framework 4.8) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build AffinityPluginLoader | |
| run: dotnet build AffinityPluginLoader/AffinityPluginLoader.csproj -c Debug | |
| - name: Build WineFix | |
| run: dotnet build WineFix/WineFix.csproj -c Debug | |
| - name: Build AffinityHook | |
| run: dotnet build AffinityHook/AffinityHook.csproj -c Debug | |
| - name: Upload AffinityPluginLoader artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AffinityPluginLoader | |
| path: | | |
| AffinityPluginLoader/bin/Debug/net48/win-x64/AffinityPluginLoader.dll | |
| AffinityPluginLoader/bin/Debug/net48/win-x64/0Harmony.dll | |
| if-no-files-found: error | |
| - name: Upload AffinityHook artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AffinityHook | |
| path: AffinityHook/bin/Debug/net48/win-x64/AffinityHook.exe | |
| if-no-files-found: error | |
| - name: Upload WineFix artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: WineFix | |
| path: WineFix/bin/Debug/net48/win-x64/WineFix.dll | |
| if-no-files-found: error | |
| # Build d2d1.dll for Wine (x86_64-unix) | |
| build-d2d1: | |
| name: Build d2d1.dll (Wine Native) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Wine development tools | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo mkdir -pm755 /etc/apt/keyrings | |
| sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key | |
| sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources | |
| sudo apt update | |
| sudo apt install -y --install-recommends wine64-tools | |
| - name: Build d2d1.dll for x86_64-unix | |
| working-directory: WineFix/lib/d2d1 | |
| run: make TARGET=x86_64-unix | |
| - name: Upload d2d1 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: d2d1 | |
| path: WineFix/lib/d2d1/build/x86_64-unix/d2d1.dll.so | |
| if-no-files-found: error | |
| # Package all artifacts into release archives | |
| package: | |
| name: Package Release Artifacts | |
| runs-on: ubuntu-latest | |
| needs: [build-bootstrap, build-csharp, build-d2d1] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get short commit hash | |
| id: commit | |
| env: | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| echo "short_sha=$(echo "$HEAD_SHA" | cut -c1-7)" >> $GITHUB_OUTPUT | |
| echo "$HEAD_SHA" > commit_sha.txt | |
| - name: Upload commit SHA | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: commit_sha | |
| path: commit_sha.txt | |
| - name: Download AffinityBootstrap artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: AffinityBootstrap | |
| path: build/bootstrap | |
| - name: Download AffinityPluginLoader artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: AffinityPluginLoader | |
| path: build/pluginloader | |
| - name: Download AffinityHook artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: AffinityHook | |
| path: build/hook | |
| - name: Download WineFix artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: WineFix | |
| path: build/winefix | |
| - name: Download d2d1 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: d2d1 | |
| path: build/d2d1 | |
| - name: Create affinitypluginloader package structure | |
| run: | | |
| mkdir -p package/affinitypluginloader | |
| cp build/bootstrap/AffinityBootstrap.dll package/affinitypluginloader/ | |
| cp build/hook/AffinityHook.exe package/affinitypluginloader/ | |
| cp build/pluginloader/AffinityPluginLoader.dll package/affinitypluginloader/ | |
| cp build/pluginloader/0Harmony.dll package/affinitypluginloader/ | |
| cp AffinityPluginLoader/LICENSE package/affinitypluginloader/LICENSE | |
| cp README.md package/affinitypluginloader/README.md | |
| - name: Create apl-winefix package structure | |
| run: | | |
| mkdir -p package/winefix/apl/plugins | |
| cp build/winefix/WineFix.dll package/winefix/apl/plugins/ | |
| cp WineFix/LICENSE package/winefix/apl/plugins/LICENSE | |
| cp build/d2d1/d2d1.dll.so package/winefix/d2d1.dll | |
| - name: Create combined package structure | |
| run: | | |
| mkdir -p package/combined/apl/plugins | |
| cp build/bootstrap/AffinityBootstrap.dll package/combined/ | |
| cp build/hook/AffinityHook.exe package/combined/ | |
| cp build/pluginloader/AffinityPluginLoader.dll package/combined/ | |
| cp build/pluginloader/0Harmony.dll package/combined/ | |
| cp build/winefix/WineFix.dll package/combined/apl/plugins/ | |
| cp build/d2d1/d2d1.dll.so package/combined/d2d1.dll | |
| - name: Create release archives | |
| run: | | |
| cd package/affinitypluginloader | |
| zip -r ../../affinitypluginloader-${{ steps.commit.outputs.short_sha }}-x64.zip . | |
| cd ../winefix | |
| zip -r ../../apl-winefix-${{ steps.commit.outputs.short_sha }}-x64.zip . | |
| cd ../combined | |
| tar -cJf ../../affinitypluginloader-plus-winefix-${{ steps.commit.outputs.short_sha }}-x64.tar.xz . | |
| cd ../.. | |
| - name: Upload affinitypluginloader package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: affinitypluginloader-${{ steps.commit.outputs.short_sha }}-x64 | |
| path: package/affinitypluginloader/ | |
| if-no-files-found: error | |
| - name: Upload apl-winefix package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apl-winefix-${{ steps.commit.outputs.short_sha }}-x64 | |
| path: package/winefix/ | |
| if-no-files-found: error | |
| - name: Upload combined package (tar.xz) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: affinitypluginloader-plus-winefix-${{ steps.commit.outputs.short_sha }}-x64.tar.xz | |
| path: affinitypluginloader-plus-winefix-${{ steps.commit.outputs.short_sha }}-x64.tar.xz | |
| if-no-files-found: error | |
| - name: Upload release archives | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-archives-${{ steps.commit.outputs.short_sha }} | |
| path: | | |
| affinitypluginloader-${{ steps.commit.outputs.short_sha }}-x64.zip | |
| apl-winefix-${{ steps.commit.outputs.short_sha }}-x64.zip | |
| affinitypluginloader-plus-winefix-${{ steps.commit.outputs.short_sha }}-x64.tar.xz | |
| if-no-files-found: error |