Skip to content

Commit

Permalink
Adds initial Windows build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
CCHyper committed Nov 17, 2022
1 parent 50b5c80 commit de1e76f
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 1 deletion.
125 changes: 125 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit de1e76f

Please sign in to comment.