-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Silver-Ore-Team/ci
Add GitHub Actions
- Loading branch information
Showing
9 changed files
with
273 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Build CMake Project | ||
on: | ||
workflow_call: | ||
secrets: | ||
SSH_KEY: | ||
required: false | ||
description: SSH private key for pushing version changes | ||
inputs: | ||
cmake-preset: | ||
required: true | ||
type: string | ||
upload-artifact-dll: | ||
required: false | ||
type: string | ||
default: false | ||
upload-artifact-vdf: | ||
required: false | ||
type: string | ||
default: false | ||
msvc-toolkit: | ||
required: false | ||
type: string | ||
default: 14.4 | ||
project-version: | ||
required: false | ||
type: string | ||
default: false | ||
push-version-commit: | ||
required: false | ||
type: boolean | ||
default: false | ||
push-version-branch: | ||
required: false | ||
type: string | ||
default: main | ||
jobs: | ||
build: | ||
name: MSVC / Windows 2022 | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: TheMrMilchmann/setup-msvc-dev@v3 | ||
with: | ||
arch: x86 | ||
toolset: ${{ inputs.msvc-toolkit }} | ||
export-path-to-vcvarsall: VCVARSALL | ||
- name: CMake Setup | ||
uses: lukka/get-cmake@latest | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
persist-credentials: false | ||
- name: Set project version | ||
if: ${{ inputs.project-version != 'false' }} | ||
run: powershell ./set-version.ps1 ${{ inputs.project-version }} | ||
- name: Setup token for branch rules bypass | ||
uses: webfactory/[email protected] | ||
if: ${{ inputs.push-version-commit == true }} | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_KEY }} | ||
- name: Commit version change | ||
if: ${{ inputs.push-version-commit == true }} | ||
run: | | ||
New-Item -ItemType Directory -Force -Path ~/.ssh | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
git config --global user.name "Nekobot" | ||
git config --global user.email "[email protected]" | ||
git remote set-url origin [email protected]:Silver-Ore-Team/zMultilogue.git | ||
git fetch --all | ||
git checkout ${{ inputs.push-version-branch }} | ||
$changes = $(git status -s) | ||
if ($changes) { | ||
git add CMakeLists.txt | ||
git commit -m "[skip ci] set project version to ${{ inputs.project-version }}" | ||
git push origin ${{ inputs.push-version-branch }} | ||
} else { | ||
echo "No changes to commit" | ||
} | ||
- name: CMake Configure | ||
run: cmake --preset ${{ inputs.cmake-preset }} | ||
- name: Ninja Build | ||
run: ninja -C out/build/${{ inputs.cmake-preset }} -j 20 | ||
- name: CMake Install | ||
run: cmake --install out/build/${{ inputs.cmake-preset }} --prefix out/install/${{ inputs.cmake-preset }} | ||
- name: Archive DLL | ||
if: ${{ inputs.upload-artifact-dll != 'false' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.upload-artifact-dll }} | ||
path: out/install/${{ inputs.cmake-preset }}/bin/*.dll | ||
- name: Archive VDF | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ inputs.upload-artifact-vdf != 'false' }} | ||
with: | ||
name: ${{ inputs.upload-artifact-vdf }} | ||
path: out/install/${{ inputs.cmake-preset }}/*.vdf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: On Push | ||
permissions: write-all | ||
on: | ||
pull_request: | ||
branches: [ "main"] | ||
push: | ||
branches: [ "main", "ci"] | ||
paths-ignore: | ||
- 'README.md' | ||
- 'docs/**' | ||
jobs: | ||
build-release: | ||
name: Build Release | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
cmake-preset: x86-release | ||
upload-artifact-dll: release-dll | ||
upload-artifact-vdf: release-vdf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Release | ||
permissions: write-all | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
build-release: | ||
name: Build Release | ||
uses: ./.github/workflows/build.yml | ||
secrets: | ||
SSH_KEY: ${{ secrets.NEKOBOCIK_SSH_KEY }} | ||
with: | ||
cmake-preset: x86-release | ||
upload-artifact-dll: release-dll | ||
upload-artifact-vdf: release-vdf | ||
project-version: ${{ github.ref_name }} | ||
push-version-commit: true | ||
publish: | ||
name: Publish Release | ||
runs-on: windows-2022 | ||
needs: | ||
- build-release | ||
steps: | ||
- name: Download Release DLL | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-dll | ||
path: out/install/x86-release/bin/ | ||
- name: Download Release VDF | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-vdf | ||
path: out/install/x86-release/ | ||
- name: Prepare Release Files | ||
id: prepare-release | ||
shell: powershell | ||
env: | ||
GITHUB_REF: ${{ github.ref_name }} | ||
run: | | ||
$tag = $env:GITHUB_REF -replace '^refs/tags/', '' | ||
Compress-Archive out/install/x86-release/bin/* zMultilogue-${tag}.zip | ||
Copy-Item out/install/x86-release/zMultilogue.vdf zMultilogue-${tag}.vdf | ||
$prerelease = if (-not ($tag -match '^v?(\d+\.\d+\.\d+)$')) { 'true' } else { 'false' } | ||
echo "prerelease=${prerelease}" >> $env:GITHUB_OUTPUT | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ github.token }} | ||
generate_release_notes: true | ||
fail_on_unmatched_files: true | ||
draft: true | ||
prerelease: ${{ steps.prepare-release.outputs.prerelease }} | ||
files: | | ||
zMultilogue-*.zip | ||
zMultilogue-*.vdf |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
$version = $args[0] | ||
|
||
if ($version -match 'rollback') { | ||
if (Test-Path ./CMakeLists.txt.bak -PathType Leaf) { | ||
Remove-Item CMakeLists.txt -Force | ||
Move-Item CMakeLists.txt.bak CMakeLists.txt | ||
Write-Host "CMakeLists.txt.bak does not exist. Cannot rollback." | ||
} else { | ||
Write-Host "CMakeLists.txt.bak does not exist. Cannot rollback." | ||
exit 2 | ||
} | ||
exit 0 | ||
} | ||
|
||
if (-not ($version -match '^v?(\d+\.\d+\.\d+)(-[a-z0-9]+)?')) { | ||
Write-Host "Version must follow format: 1.2.3 or v1.2.3 or 1.2.3-alpha" | ||
Write-Host "Usage: set-version.ps1 [version]" | ||
exit 1 | ||
} | ||
|
||
if (Test-Path ./CMakeLists.txt.bak -PathType Leaf) { | ||
Write-Host "CMakeLists.txt.bak exists. Delete this file to set new version." | ||
exit 3 | ||
} | ||
|
||
$version = $version -replace '^v', '' | ||
$cmakeVersion = $version -replace '-[a-z0-9]+$', '' | ||
Write-Host "Setting version to $version" | ||
|
||
Copy-Item CMakeLists.txt CMakeLists.txt.bak | ||
$cmake = (Get-Content -Path ./CMakeLists.txt) -replace 'set\(PROJECT_VERSION "[^"]*"\)', "set(PROJECT_VERSION ""$version"")" | ||
$cmake = (Get-Content -Path ./CMakeLists.txt) -replace 'set\(PROJECT_VERSION_CMAKE "[^"]*"\)', "set(PROJECT_VERSION_CMAKE ""$cmakeVersion"")" | ||
$cmake | Set-Content -Path ./CMakeLists.txt |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
GothicVDFS 2.6 (mod) | ||
=================== | ||
|
||
What for... | ||
����������� | ||
This tool is intended to view, extract, and build | ||
Virtual Disk File System (VDFS) volumes for Gothic II. | ||
|
||
Usage | ||
����� | ||
This simple program is self-explanatory - just use it. | ||
|
||
Legal Stuff | ||
����������� | ||
Copyright (c) 2001-2003, Nico Bendlin | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
|
||
Note: VDFS is Copyright (c) 1994-2002, Peter Sabath / TRIACOM Software GmbH |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[BEGINVDF] | ||
Comment=zMultilogue v${CMAKE_PROJECT_VERSION}%%Nhttps://github.com/Silver-Ore-Team/zMultilogue%%N2024 Silver Ore Team | ||
BaseDir=vdf | ||
VDFName=zMultilogue.vdf | ||
[FILES] | ||
System\Autorun\*.dll | ||
System\*.dll | ||
[ENDVDF] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/vdf/System/Autorun") | ||
file(COPY "${CMAKE_INSTALL_PREFIX}/bin/zMultilogue.dll" DESTINATION "${CMAKE_INSTALL_PREFIX}/vdf/System/Autorun") |