diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..290c450 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,125 @@ +# +# Windows build action for ebfd-patches. +# +# Authors: CCHyper, OmniBlade +# + +name: Windows + +on: + push: + branches: [ master ] + +jobs: + create_release: + runs-on: ubuntu-18.04 + steps: + - name: Delete Previous Release + uses: dev-drprasad/delete-tag-and-release@v0.2.0 + with: + delete_release: true + tag_name: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build: + name: Build + runs-on: windows-latest + strategy: + fail-fast: false + + steps: + - name: Clone Repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get Branch Name + id: branch-name + uses: tj-actions/branch-names@v5.2 + + - name: Set Variables + id: gitinfo + run: | + echo "Branch name: '${{ steps.branch-name.outputs.current_branch }}'" + + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "::set-output name=date::$(git show -s --date=format:'%Y-%m-%d' --format=%cd HEAD)" + + - name: MSVC Dev Cmd + uses: ilammy/msvc-dev-cmd@v1.10.0 + with: + arch: x86 + + - name: Download WinBuilds + uses: suisei-cn/actions-download-file@v1 + with: + url: "https://downloads.cncnet.org/WinBuilds32ForGitHubCI.zip" + + - name: Install WinBuilds + run: | + 7z x WinBuilds32ForGitHubCI.zip -owin-builds-patch-32 + Get-ChildItem + Get-ChildItem -Path 'win-builds-patch-32' + + - name: Add WinBuilds To PATH + run: | + echo "$env:GITHUB_WORKSPACE\win-builds-patch-32" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "$env:GITHUB_WORKSPACE\win-builds-patch-32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Build Binaries + run: | + Get-ChildItem + + New-Item -Path 'build\release' -ItemType Directory + + gmake clean + gmake -j8 + Move-Item -Path 'game.exe' -Destination 'build\release\Game.exe' + + New-Item -Path 'build\debug' -ItemType Directory + + gmake clean + gmake -j8 WWDEBUG=1 + Move-Item -Path 'game.exe' -Destination 'build\debug\Game.exe' + + Get-ChildItem -Path 'build\release' + Get-ChildItem -Path 'build\debug' + + - name: Copy Binaries + run: | + New-Item -Path 'artifact\release' -ItemType Directory + New-Item -Path 'artifact\debug' -ItemType Directory + + Move-Item -Path 'build\release\Game.exe' -Destination 'artifact\release\Game.exe' + Move-Item -Path 'build\debug\Game.exe' -Destination 'artifact\debug\Game.exe' + + Get-ChildItem -Path 'artifact\release' + Get-ChildItem -Path 'artifact\debug' + + Get-ChildItem + Get-ChildItem -Path 'build' + Get-ChildItem -Path 'artifact' + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ebfd-patches-${{ matrix.type }}-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}-${{ steps.gitinfo.outputs.date }} + path: artifact + + - name: Create Archive For Release + run: | + Get-ChildItem -Path 'build' + 7z a ebfd-patches-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}.zip .\artifact\* + + - name: Upload New Release + if: ${{ github.event_name != 'pull_request' }} + uses: softprops/action-gh-release@v1 + with: + name: Latest + tag_name: latest + body: Latest ebfd-patches binaries. + files: | + ebfd-patches-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index a1e53c7..3fb624a 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -include config.mk INPUT = game.dat -OUTPUT = emperor.exe +OUTPUT = game.exe LDS = game.lds IMPORTS = 0x1ECEB0 320 LD_CFLAGS = -Wl,--section-alignment=0x1000 -Wl,--subsystem=windows -Wl,--enable-stdcall-fixup