Skip to content

Commit

Permalink
GitHub Actions Ci workflow (#66)
Browse files Browse the repository at this point in the history
* Add github actions workflow
* Adjust badges to point to Kirides
* Fix badge link in Readme
* Create build workflow and rename previous release workflow
* Add explanation to github release creation step
* Add spacer.net configuration and improve release directory setup
* Fix replace command
* Adjust file name (g2: avx2)
  • Loading branch information
G00fY2 committed Jul 19, 2021
1 parent 5a27cd5 commit 8466d5c
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

defaults:
run:
shell: pwsh

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release_AVX, Release_G1_AVX, Release, Release_G1, Spacer_NET]

steps:
- uses: actions/checkout@v2

- 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=${{matrix.configuration}} .
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release

on:
push:
tags:
- 'v*'

defaults:
run:
shell: pwsh

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}
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=${{matrix.configuration}} .

- 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 "${{matrix.configuration}}\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}} -p -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}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GD3D11 [![Build status](https://ci.appveyor.com/api/projects/status/6svu1ma594tr06y9/branch/master?svg=true)](https://ci.appveyor.com/project/BonneCW/gd3d11)
# GD3D11 [![GitHub Actions](https://github.com/kirides/GD3D11/actions/workflows/build.yml/badge.svg)](https://github.com/Kirides/GD3D11/actions) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Kirides/GD3D11?include_prereleases)](https://github.com/Kirides/GD3D11/releases)

With this mod for the games "Gothic" and "Gothic 2", I want to bring the engine of those games into a more modern state. Through an own implementation of the DirectDraw-API and using hooking and assemblercode-modifications of gothics intern engine calls, I have managed to completely replace gothics old rendering architecture with a new one, which is able to utilize more of the current GPU generations power for rendering.
Since Gothic's engine in its original state tries to cull as much as possible, this takes a lot of work from the CPU, which was slowing down the game even on todays processors. While the original renderer did a really great job with the tech from 2002, GPUs have grown much faster.
Expand Down

0 comments on commit 8466d5c

Please sign in to comment.