rename to gmod, drop gui (#1) #1
This file contains 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
# This continuous integration pipeline is triggered anytime a user pushes code to the repo. | |
# This pipeline builds the Wpf project, runs unit tests, then saves the MSIX build artifact. | |
name: uMod CD Pipeline | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
targetplatform: [x86] | |
runs-on: windows-latest | |
env: | |
Configuration: Release | |
Actions_Allow_Unsecure_Commands: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Config | |
run: echo "DXSDK_DIR=DXSDK" >> $GITHUB_ENV | |
shell: bash | |
- name: Cache | |
id: cache | |
uses: actions/cache@v1 | |
with: | |
path: DXSDK | |
key: DXSDK | |
- name: Cache create | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe | |
7z x _DX2010_.exe DXSDK/Include | |
7z x _DX2010_.exe DXSDK/Lib/x86 | |
shell: bash | |
- name: Echo cache | |
run: echo ${{ env.DXSDK_DIR }} | |
- name: List dxsdk files | |
run: | | |
cd DXSDK | |
ls | |
cd Include | |
ls | |
cd ../Lib/x86 | |
ls | |
- name: Copy DirectX headers to project include directory | |
run: Copy-Item -Path "${{ env.DXSDK_DIR }}/Include/*" -Destination header/ -Recurse -Force | |
env: | |
DXSDK_DIR: ${{ env.DXSDK_DIR }} | |
shell: pwsh | |
- name: Ensure Lib directory exists and copy DirectX libraries | |
run: | | |
$libDir = "Lib/" | |
if (-Not (Test-Path -Path $libDir)) { | |
New-Item -ItemType Directory -Path $libDir | |
} | |
Copy-Item -Path "${{ env.DXSDK_DIR }}/Lib/x86/*" -Destination $libDir -Recurse -Force | |
env: | |
DXSDK_DIR: ${{ env.DXSDK_DIR }} | |
shell: pwsh | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Build CMake Files | |
run: cmake -S . -B build -A Win32 | |
env: | |
DXSDK_DIR: ${{ env.DXSDK_DIR }} | |
- name: Build binaries | |
run: cmake --build build --config Release | |
env: | |
DXSDK_DIR: ${{ env.DXSDK_DIR }} | |
- name: Retrieve version | |
id: set_version | |
run: | | |
$fileVersionInfo = (Get-Item -Path .\bin\Release\gMod.dll).VersionInfo.FileVersion | |
if ([string]::IsNullOrEmpty($fileVersionInfo)) { | |
Write-Host "The DLL file version information could not be retrieved." | |
exit 1 | |
} else { | |
Write-Host "FileVersionInfo: $fileVersionInfo" | |
echo "::set-output name=version::$fileVersionInfo" | |
} | |
shell: pwsh | |
- name: Publish release | |
uses: Xotl/[email protected] | |
with: | |
mode: update | |
tag_name: v${{ steps.set_version.outputs.version }} | |
release_name: gMod v${{ steps.set_version.outputs.version }} | |
assets: .\bin\Release\gMod.dll | |
github_token: ${{ env.GITHUB_TOKEN }} | |
replace_assets: true | |
body_mrkdwn: ${{ env.Changelog }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |