Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Nov 10, 2024
0 parents commit eae03aa
Show file tree
Hide file tree
Showing 139 changed files with 7,800 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report 🐞
about: Create a report to help us improve. If you come here from a 7th Heaven crash, DO NOT open an issue, as it will be closed IMMEDIATELY. Consider opening a discussion thread instead!
title: "[ GAME ] ISSUE"
labels: bug
assignees: ""
---

**PLEASE NOTE:** If you come here to report a crash while you were using 7th Heaven, please do on their relative support channels. NO SUPPORT will be provided, and your issue will be close immediately.

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**GPU (please complete the following information):**

- Brand [e.g. Nvidia]
- Driver Version [e.g. 27.21.14.5730]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature Request 💡
about: Suggest a new idea for the project.
labels: enhancement
---

## Summary

Brief explanation of the feature.

### Basic example

If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable.

### Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Summary

Brief explanation of the pull request.

### Motivation

Why are you doing this? What use cases does it support? What is the expected outcome?

### ACKs

- [ ] I have updated the [Changelog.md](https://github.com/julianxhokaxhiu/CTNx/blob/master/Changelog.md) file
- [ ] I did test my code on the game
44 changes: 44 additions & 0 deletions .github/workflows/alert.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#*****************************************************************************#
# Copyright (C) 2024 Julian Xhokaxhiu #
# #
# This file is part of CTNx #
# #
# CTNx is free software: you can redistribute it and\or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License #
# #
# CTNx is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
#*****************************************************************************#

# $downloadUrl = "https://github.com/julianxhokaxhiu/CTNx/releases/latest"

# if ($env:_IS_BUILD_CANARY -eq "true") {
# $downloadUrl = "https://github.com/julianxhokaxhiu/CTNx/releases/tag/canary"
# }

# # Initial template from https://discohook.org/
# $discordPost = @"
# {
# "username": "CTNx",
# "avatar_url": "https://github.com/julianxhokaxhiu/CTNx/raw/master/.logo/logo_whitebg.png",
# "content": "Release **${env:_RELEASE_VERSION}** has just been published!\n\nDownload Url: ${downloadUrl}\n\nIf you find something broken or unexpected, feel free to check existing ones first here https://github.com/julianxhokaxhiu/CTNx/issues.\nIf non existing, then report your issue here https://github.com/julianxhokaxhiu/CTNx/issues/new.\n\nThank you for using CTNx!",
# "embeds": [
# {
# "title": "How to install",
# "description": "Feel free to follow instructions at this link, depending on which version of the game you own: https://github.com/julianxhokaxhiu/CTNx/blob/master/docs/how_to_install.md",
# "color": 7506394
# },
# {
# "title": "CTNx is FOSS Software!",
# "description": "CTNx is released under GPLv3 license. More info here: https://github.com/julianxhokaxhiu/CTNx#license",
# "color": 15746887
# }
# ]
# }
# "@

# Invoke-RestMethod -Uri $env:_MAP_CTNx_QHIMM_CT -ContentType "application/json" -Method Post -Body $discordPost
# Invoke-RestMethod -Uri $env:_MAP_CTNx_TSUNAMODS_CT -ContentType "application/json" -Method Post -Body $discordPost
103 changes: 103 additions & 0 deletions .github/workflows/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#*****************************************************************************#
# Copyright (C) 2024 Julian Xhokaxhiu #
# #
# This file is part of CTNx #
# #
# CTNx is free software: you can redistribute it and\or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License #
# #
# CTNx is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
#*****************************************************************************#

Set-StrictMode -Version Latest

if ($env:_BUILD_BRANCH -eq "refs/heads/master" -Or $env:_BUILD_BRANCH -eq "refs/tags/canary")
{
$env:_IS_BUILD_CANARY = "true"
$env:_IS_GITHUB_RELEASE = "true"
}
elseif ($env:_BUILD_BRANCH -like "refs/tags/*")
{
$env:_CHANGELOG_VERSION = $env:_BUILD_VERSION.Substring(0,$env:_BUILD_VERSION.LastIndexOf('.')).Replace('.','')
$env:_BUILD_VERSION = $env:_BUILD_VERSION.Substring(0,$env:_BUILD_VERSION.LastIndexOf('.')) + ".0"
$env:_IS_GITHUB_RELEASE = "true"
}
$env:_RELEASE_VERSION = "v${env:_BUILD_VERSION}"

$vcpkgRoot = "C:\vcpkg"
$vcpkgBaseline = [string](jq --arg baseline "builtin-baseline" -r '.[$baseline]' vcpkg.json)
$vcpkgOriginUrl = &"git" -C $vcpkgRoot remote get-url origin
$vcpkgBranchName = &"git" -C $vcpkgRoot branch --show-current

$releasePath = [string](jq -r '.configurePresets[0].binaryDir' CMakePresets.json).Replace('${sourceDir}/', '')

Write-Output "--------------------------------------------------"
Write-Output "BUILD CONFIGURATION: $env:_RELEASE_CONFIGURATION"
Write-Output "RELEASE VERSION: $env:_RELEASE_VERSION"
Write-Output "VCPKG ORIGIN: $vcpkgOriginUrl"
Write-Output "VCPKG BRANCH: $vcpkgBranchName"
Write-Output "VCPKG BASELINE: $vcpkgBaseline"
Write-Output "--------------------------------------------------"

Write-Output "_BUILD_VERSION=${env:_BUILD_VERSION}" >> ${env:GITHUB_ENV}
Write-Output "_RELEASE_VERSION=${env:_RELEASE_VERSION}" >> ${env:GITHUB_ENV}
Write-Output "_IS_BUILD_CANARY=${env:_IS_BUILD_CANARY}" >> ${env:GITHUB_ENV}
Write-Output "_IS_GITHUB_RELEASE=${env:_IS_GITHUB_RELEASE}" >> ${env:GITHUB_ENV}
Write-Output "_CHANGELOG_VERSION=${env:_CHANGELOG_VERSION}" >> ${env:GITHUB_ENV}

# Install CMake
Write-Output "Installing cmake v${env:_WINGET_CMAKE}..."
winget install Kitware.CMake --version ${env:_WINGET_CMAKE} --silent --uninstall-previous --accept-source-agreements --accept-package-agreements --disable-interactivity --force | out-null
cmake --version

# Install Powershell
Write-Output "Installing powershell v${env:_WINGET_POWERSHELL}..."
winget install Microsoft.PowerShell --version ${env:_WINGET_POWERSHELL} --silent --uninstall-previous --accept-source-agreements --accept-package-agreements --disable-interactivity --force | out-null
pwsh --version

# Install Visual Studio Enterprise
Write-Output "Installing VisualStudio 2022 Enterprise v${env:_WINGET_VS2022}..."
winget install Microsoft.VisualStudio.2022.Enterprise --version ${env:_WINGET_VS2022} --silent --accept-source-agreements --accept-package-agreements --disable-interactivity --force | out-null

# Load vcvarsall environment for x86
$vcvarspath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -property InstallationPath
cmd.exe /c "call `"$vcvarspath\VC\Auxiliary\Build\vcvarsall.bat`" x86 && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}

# Unset VCPKG_ROOT if set
[Environment]::SetEnvironmentVariable('VCPKG_ROOT','')

# Add Github Packages registry
nuget sources add -Name github -Source "https://nuget.pkg.github.com/julianxhokaxhiu/index.json" -Username ${env:GITHUB_REPOSITORY_OWNER} -Password ${env:GITHUB_PACKAGES_PAT} -StorePasswordInClearText
nuget setApiKey ${env:GITHUB_PACKAGES_PAT} -Source "https://nuget.pkg.github.com/julianxhokaxhiu/index.json"
nuget sources list

# Vcpkg setup
git -C $vcpkgRoot pull --all
git -C $vcpkgRoot checkout $vcpkgBaseline
git -C $vcpkgRoot clean -fxd

cmd.exe /c "call $vcpkgRoot\bootstrap-vcpkg.bat"

vcpkg integrate install

# Start the build
cmake --preset "${env:_RELEASE_CONFIGURATION}" -D_DLL_VERSION="$env:_BUILD_VERSION"
cmake --build --preset "${env:_RELEASE_CONFIGURATION}"

# Start the packaging
mkdir .dist\pkg\CTNx | Out-Null
Copy-Item -R "$releasePath\bin\*" .dist\pkg\CTNx
Move-Item .dist\pkg\CTNx\CTNx.dll .dist\pkg\CTNx\version.dll

7z a ".\.dist\${env:_RELEASE_NAME}-${env:_RELEASE_VERSION}.zip" ".\.dist\pkg\CTNx\*"

Remove-Item -Recurse -Force .dist\pkg
124 changes: 124 additions & 0 deletions .github/workflows/main-0.0.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: CTNx

run-name: 0.0.1.${{ github.run_number }}

on:
workflow_dispatch:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master

env:
_IS_BUILD_CANARY: false
_IS_GITHUB_RELEASE: false
_RELEASE_NAME: CTNx
_RELEASE_VERSION: v0
_RELEASE_CONFIGURATION: Release
_BUILD_BRANCH: "${{ github.ref }}"
_CHANGELOG_VERSION: "0"
# GIT: Fix reporting from stderr to stdout
GIT_REDIRECT_STDERR: 2>&1
# Tools versions
_WINGET_CMAKE: 3.30.3
_WINGET_POWERSHELL: 7.4.5
_WINGET_VS2022: 17.11.1

jobs:
CTNx:
runs-on: windows-latest
timeout-minutes: 1440
strategy:
max-parallel: 1
steps:
- name: Set Git Config
run: |
git config --global core.autocrlf false
git config --global core.filemode false
git config --global core.longpaths true
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Install WinGet
uses: Cyberboss/install-winget@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: ".github/workflows/build.ps1"
shell: pwsh
env:
_BUILD_VERSION: "0.0.1.${{ github.run_number }}"
GITHUB_PACKAGES_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Publish PR artifacts
if: env._IS_GITHUB_RELEASE == 'false' && success()
uses: actions/upload-artifact@v4.0.0
with:
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
path: ".dist/*.zip"
- name: VirusTotal Scan
id: vt-scan
if: env._IS_GITHUB_RELEASE == 'true' && success()
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets._VT_API_KEY }}
files: ".dist/*.zip"
- name: Parse VirusTotal Results
id: vt-res
if: env._IS_GITHUB_RELEASE == 'true' && success()
uses: actions/github-script@v7
with:
result-encoding: string
script: |
let ret = `${{ steps.vt-scan.outputs.analysis }}`;
ret = '- ' + ret
.replaceAll('.dist/','')
.replaceAll('=h', ': h')
.replaceAll(',', "\n- ");
console.log('Results:');
console.log(ret);
return ret;
- name: Publish Canary release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'true' && success()
with:
artifacts: ".dist/*.zip"
allowUpdates: true
generateReleaseNotes: true
prerelease: true
removeArtifacts: true
tag: canary
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
body: |
See https://github.com/julianxhokaxhiu/CTNx/blob/master/Changelog.md#next
This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!
🛡️ **VirusTotal analysis:**
${{ steps.vt-res.outputs.result }}
- name: Publish Stable release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'false' && success()
with:
artifacts: ".dist/*.zip"
generateReleaseNotes: true
makeLatest: true
removeArtifacts: true
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
body: |
See https://github.com/julianxhokaxhiu/CTNx/blob/master/Changelog.md#${{ env._CHANGELOG_VERSION }}
🛡️ **VirusTotal analysis:**
${{ steps.vt-res.outputs.result }}
- name: Send alerts
if: env._IS_GITHUB_RELEASE == 'true' && success()
env:
_MAP_CTNx_TSUNAMODS_CT: "${{ secrets._CTNx_TSUNAMODS_CT }}"
_MAP_CTNx_QHIMM_CT: "${{ secrets._CTNx_QHIMM_CT }}"
run: ".github/workflows/alert.ps1"
shell: pwsh
Loading

0 comments on commit eae03aa

Please sign in to comment.