Skip to content

Commit

Permalink
Build Pipeline updated. Single zip for everything but Spacer_NET
Browse files Browse the repository at this point in the history
  • Loading branch information
kirides committed Dec 14, 2021
1 parent 741a7ea commit 1c9ceb4
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release_AVX, Release_G1_AVX, Release, Release_G1, Spacer_NET]
configuration: [Release_AVX, Release_G1_AVX, Release, Release_G1, Spacer_NET, Launcher]

steps:
- uses: actions/checkout@v2
Expand Down
46 changes: 27 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,14 @@ defaults:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
include:
- configuration: Release_AVX
output_dir: Gothic2-GD3D11-#VERSION#_avx2
- configuration: Release_G1_AVX
output_dir: Gothic1-GD3D11-#VERSION#_avx
- configuration: Release
output_dir: Gothic2-GD3D11-#VERSION#
- configuration: Release_G1
output_dir: Gothic1-GD3D11-#VERSION#
- configuration: Spacer_NET
output_dir: Gothic2-GD3D11-#VERSION#_SpacerNET

steps:
- uses: actions/checkout@v2

- name: Set tag and directory name env
run: |
$tagName = $Env:GITHUB_REF -replace 'refs/tags/', ''
$dirName = "${{matrix.output_dir}}" -replace '#VERSION#', ${tagName}
$dirName = "GD3D11-${tagName}"
echo "Tag: ${tagName}"
echo "Directory: ${dirName}"
echo "RELEASE_VERSION=${tagName}" >> $Env:GITHUB_ENV
Expand All @@ -45,21 +32,42 @@ jobs:
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore .

- name: Build
- name: Build G2 NotR AVX
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=${{matrix.configuration}} .
run: msbuild /p:Configuration=Release_AVX .

- name: Build G1 AVX
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=Release_G1_AVX .

- name: Build G2 NotR
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=Release .

- name: Build G1
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=Release_G1 .

- name: Build Launcher
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
msbuild /p:Configuration=Launcher .
- name: Create distribution zip
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir "${{env.RELEASE_DIR}}\GD3D11\shaders\CSFFT"
mkdir "${{env.RELEASE_DIR}}\GD3D11\Bin"
Xcopy "D3D11Engine\Shaders\*" "${{env.RELEASE_DIR}}\GD3D11\shaders" /s
copy "D3D11Engine\CSFFT\*.hlsl" "${{env.RELEASE_DIR}}\GD3D11\shaders\CSFFT"
Xcopy "blobs\data" "${{env.RELEASE_DIR}}\GD3D11\data\" /s
Xcopy "blobs\Meshes" "${{env.RELEASE_DIR}}\GD3D11\Meshes\" /s
Xcopy "blobs\Textures" "${{env.RELEASE_DIR}}\GD3D11\Textures\" /s
Xcopy "blobs\libs\*" "${{env.RELEASE_DIR}}\" /s
copy "${{matrix.configuration}}\ddraw.dll" "${{env.RELEASE_DIR}}"
copy "Release_AVX\ddraw.dll" "${{env.RELEASE_DIR}}\GD3D11\Bin\g2a_avx2.dll"
copy "Release\ddraw.dll" "${{env.RELEASE_DIR}}\GD3D11\Bin\g2a.dll"
copy "Release_G1_AVX\ddraw.dll" "${{env.RELEASE_DIR}}\GD3D11\Bin\g1_avx.dll"
copy "Release_G1\ddraw.dll" "${{env.RELEASE_DIR}}\GD3D11\Bin\g1.dll"
copy "Launcher\ddraw.dll" "${{env.RELEASE_DIR}}\"
cd "${{env.RELEASE_DIR}}"
7z a -tzip "..\${{env.RELEASE_DIR}}.zip" -r
Expand All @@ -82,4 +90,4 @@ jobs:
gh release upload ${{env.RELEASE_VERSION}} "${{env.RELEASE_DIR}}.zip"
gh release upload ${{env.RELEASE_VERSION}} "${{env.RELEASE_DIR}}.zip.sha256"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
72 changes: 72 additions & 0 deletions .github/workflows/release_spacer-net.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release Spacer_NET

on:
push:
tags:
- 'v*'

defaults:
run:
shell: pwsh

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Set tag and directory name env
run: |
$tagName = $Env:GITHUB_REF -replace 'refs/tags/', ''
$dirName = "Gothic2-GD3D11-${tagName}_SpacerNET"
echo "Tag: ${tagName}"
echo "Directory: ${dirName}"
echo "RELEASE_VERSION=${tagName}" >> $Env:GITHUB_ENV
echo "RELEASE_DIR=${dirName}" >> $Env:GITHUB_ENV
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore .

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=Spacer_NET .

- name: Create distribution zip
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir "${{env.RELEASE_DIR}}\GD3D11\shaders\CSFFT"
Xcopy "D3D11Engine\Shaders\*" "${{env.RELEASE_DIR}}\GD3D11\shaders" /s
copy "D3D11Engine\CSFFT\*.hlsl" "${{env.RELEASE_DIR}}\GD3D11\shaders\CSFFT"
Xcopy "blobs\data" "${{env.RELEASE_DIR}}\GD3D11\data\" /s
Xcopy "blobs\Meshes" "${{env.RELEASE_DIR}}\GD3D11\Meshes\" /s
Xcopy "blobs\Textures" "${{env.RELEASE_DIR}}\GD3D11\Textures\" /s
Xcopy "blobs\libs\*" "${{env.RELEASE_DIR}}\" /s
copy "Spacer_NET\ddraw.dll" "${{env.RELEASE_DIR}}"
cd "${{env.RELEASE_DIR}}"
7z a -tzip "..\${{env.RELEASE_DIR}}.zip" -r
- name: Calculate distribution zip hash
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
(Get-FileHash "${{env.RELEASE_DIR}}.zip" -Algorithm SHA256).hash | Out-File -FilePath "${{env.RELEASE_DIR}}.zip.sha256"
type "${{env.RELEASE_DIR}}.zip.sha256"
- name: Create github release
run: |
gh release create ${{env.RELEASE_VERSION}} -n "Generated release from GitHub Actions"
echo "Ignore 'Validation Failed' results. Expected since only the first job that reaches this step can create the release."
exit 0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Upload artifacts to github release
run: |
gh release upload ${{env.RELEASE_VERSION}} "${{env.RELEASE_DIR}}.zip"
gh release upload ${{env.RELEASE_VERSION}} "${{env.RELEASE_DIR}}.zip.sha256"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Binary file removed blobs/data/DeviceEnum.bin
Binary file not shown.
Binary file removed blobs/data/FormatEnum.bin
Binary file not shown.
Binary file removed blobs/data/ModesEnum.bin
Binary file not shown.
Binary file removed blobs/data/ZBufferEnum.bin
Binary file not shown.

0 comments on commit 1c9ceb4

Please sign in to comment.