Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
artifact-name:
description: "Artifact file name"
required: false
default: compiled-dll-${{ github.sha }}
default: ''

runs:
using: "composite"
Expand All @@ -27,16 +27,14 @@ runs:
working-directory: ${{ env.GITHUB_WORKSPACE }}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{inputs.build-config}} /p:GitCommit=${{github.sha}} /p:GitBranch=${{github.ref}} ${{inputs.sln-path}}
run: msbuild /m /p:Configuration=${{inputs.build-config}} /p:GitCommit=${{github.sha}} /p:GitBranch=${{github.ref}} /v:q ${{inputs.sln-path}}
shell: cmd

- name: Upload Artifact
if: ${{ success() }}
if: ${{ success() && inputs.artifact-name != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
${{inputs.sln-path}}/${{inputs.build-config}}/CnCNet-Spawner.dll
${{inputs.sln-path}}/${{inputs.build-config}}/CnCNet-Spawner.pdb
./LICENSE.md
./README.md
25 changes: 11 additions & 14 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,28 @@ on:
push:
branches:
- main
- master
- develop

env:
SOLUTION_PATH: .
BUILD_CONFIGURATION: DevBuild
pull_request:

jobs:
build:
runs-on: windows-2019

strategy:
matrix:
build-type: [DevBuild] # [Debug, DevBuild, Release]
is-cncnet-yr: ['', -CnCNetYR]
is-hardened: ['', -Hardened]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}

- name: Build
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}
artifact-name: compiled-dll-regular-${{ github.sha }}

- name: Build HardEnd
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
artifact-name: compiled-dll-hardend-${{ github.sha }}
build-config: ${{ matrix.build-type }}${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}
artifact-name: spawner${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}-${{ github.sha }}
32 changes: 0 additions & 32 deletions .github/workflows/pr-nightly-build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr-nightly-comment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Nightly Build Comment on Pull Request"
on:
workflow_run:
workflows: ['Pull Request Nightly Build']
workflows: ['Nightly Build']
types: [completed]
jobs:
pr_comment:
Expand Down
70 changes: 16 additions & 54 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,40 @@
name: "Release Build"

on:
push:
tags:
- "v*.*.*.*"
release:
types: [published]

env:
RELEASE_NAME: ${{ github.ref_name }}
ARTIFACT_NAME: CnCNet-Spawner_${{ github.ref_name }}

SOLUTION_PATH: .
BUILD_CONFIGURATION: Release
BUILD_CONFIG: ${{ matrix.build-type }}${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}
ARCHIVE_NAME: CnCNet-Spawner${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}-${{ github.ref_name }}.zip

jobs:
build:
runs-on: windows-2019

strategy:
matrix:
build-type: [Release] # [Debug, DevBuild, Release]
is-cncnet-yr: ['', -CnCNetYR]
is-hardened: ['', -Hardened]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}

- name: Build
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}
artifact-name: compiled-dll-regular-${{ github.sha }}

- name: Build HardEnd
uses: ./.github/actions/build
with:
sln-path: ${{ env.SOLUTION_PATH }}
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
artifact-name: compiled-dll-hardend-${{ github.sha }}
build-config: ${{ env.BUILD_CONFIG }}

- name: Create Archive For Release
run: |
mkdir ./artifact
mkdir ./artifact/Regular
copy ./LICENSE.md ./artifact/Regular/LICENSE.md
copy ./README.md ./artifact/Regular/README.md
copy ./${{ env.BUILD_CONFIGURATION }}/CnCNet-Spawner.pdb ./artifact/Regular/CnCNet-Spawner.pdb
copy ./${{ env.BUILD_CONFIGURATION }}/CnCNet-Spawner.dll ./artifact/Regular/CnCNet-Spawner.dll
7z a ${{ env.ARTIFACT_NAME }}.zip ./artifact/Regular/*
mkdir ./artifact/HardEnd
copy ./LICENSE.md ./artifact/HardEnd/LICENSE.md
copy ./README.md ./artifact/HardEnd/README.md
copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/CnCNet-Spawner.pdb" ./artifact/HardEnd/CnCNet-Spawner.pdb
copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/CnCNet-Spawner.dll" ./artifact/HardEnd/CnCNet-Spawner.dll
7z a ${{ env.ARTIFACT_NAME }}-HardEnd.zip ./artifact/HardEnd/*
- name: Create an Archive for the Release
run: 7z a ${{ env.ARCHIVE_NAME }}.zip ./LICENSE.md ./${{ env.BUILD_CONFIG }}/CnCNet-Spawner.dll ./${{ env.BUILD_CONFIG }}/CnCNet-Spawner.pdb

- name: Upload New Release
- name: Upload Files to the Release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.RELEASE_NAME }}
body: ${{ env.RELEASE_NAME }}
append_body: true
draft: true
files: |
${{ env.ARTIFACT_NAME }}.zip
${{ env.ARTIFACT_NAME }}-HardEnd.zip
files: ${{ env.ARCHIVE_NAME }}

request-anti-cheat-build:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Request AntiCheat Build
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/cncnet/yrpp-spawner-private/actions/workflows/release-build-by-request.yml/dispatches \
-d '{"ref":"main", "inputs":{"tag": "${{ github.ref_name }}"}}'
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
yrpp-spawner-private/
Release/**
Release-Hardened/**
DevBuild/**
DevBuild-Hardened/**
Debug/**
Release-HardEnd/**
DevBuild-HardEnd/**
Debug-HardEnd/**
Debug-Hardened/**
Release-CnCNetYR/**
Release-CnCNetYR-Hardened/**
DevBuild-CnCNetYR/**
DevBuild-CnCNetYR-Hardened/**
Debug-CnCNetYR/**
Debug-CnCNetYR-Hardened/**

.vs/**
.vscode/**
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "YRpp"]
path = YRpp
url = git@github.com:CnCNet/YRpp.git
[submodule "Private"]
path = Private
url = git@github.com:CnCNet/yrpp-spawner-private.git
68 changes: 56 additions & 12 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,21 @@
"version": "2.0.0",
"tasks": [
{
"label": "Build debug build",
"label": "Build",
"type": "process",
"command": [],
"windows": {
"command": "scripts/build_debug.bat"
"command": "scripts/build.bat",
"args": [
"${input:buildType}${input:isCnCNetYR}${input:isHardened}"
]
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
},
{
"label": "Build release build",
"type": "process",
"command": [],
"windows": {
"command": "scripts/build_release.bat"
},
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "Cleanup build folders",
"type": "process",
Expand Down Expand Up @@ -65,5 +58,56 @@
"showReuseMessage": false
}
}
],
"inputs": [
{
"id": "buildType",
"type": "pickString",
"options": [
{
"value": "Debug"
},
{
"value": "DevBuild"
},
{
"value": "Release"
}
],
"default": "Debug",
"description": "Select the build type"
},
{
"id": "isCnCNetYR",
"type": "pickString",
"options": [
{
"value": "",
"label": "No"
},
{
"value": "-CnCNetYR",
"label": "Yes"
}
],
"default": "",
"description": "Is this a CnCNet YR build?"
},
{
"id": "isHardened",
"type": "pickString",
"options": [
{
"value": "",
"label": "No"
},
{
"value": "-Hardened",
"label": "Yes"
}
],
"default": "",
"description": "Is this a hardened build? (Enables additional security features)"
}
]
}
1 change: 1 addition & 0 deletions Private
Submodule Private added at b2461c
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ Downloads
Building manually
-----------------

1. Install **Visual Studio** (2019 is recommended, 2017 is minimum) with the dependencies listed in `.vsconfig` (it will prompt you to install missing dependencies when you open the project, or you can run VS installer and import the config). If you prefer to use **Visual Studio Code** you may install **VS Build Tools** with the dependencies from `.vsconfig` instead. Not using a code editor or IDE and building via **command line scripts** included with the project is also an option.
2. Clone this repo recursively via your favorite git client (that will also clone YRpp).
1. Install **Visual Studio** (2022 is recommended, 2019 is minimum) with the dependencies listed in `.vsconfig` (it will prompt you to install missing dependencies when you open the project, or you can run VS installer and import the config). If you prefer to use **Visual Studio Code** you may install **VS Build Tools** with the dependencies from `.vsconfig` instead. Not using a code editor or IDE and building via **command line scripts** included with the project is also an option.
2. Clone this repo recursively via your favorite git client (that will also clone YRpp and private submodule, if you have access).
3. To build the extension:
- in Visual Studio: open the solution file in VS and build it (`Debug` build config is recommended);
- in VSCode: open the project folder and hit `Run Build Task...` (`Ctrl + Shift + B`);
- barebones: run `scripts/build_debug.bat`.
- in VSCode: open the project folder, hit `Run Build Task...` (`Ctrl + Shift + B`) and select the needed config;
- barebones: run the corresponding `scripts/build_*.bat`.
4. Upon build completion the resulting `CnCNet-Spawner.dll` and `CnCNet-Spawner.pdb` would be placed in the subfolder identical to the name of the build config executed.

Please note that you can build the hardened version only if you have access to it's source code. It is though automatically built and made available to download on pull requests, releases and nightly builds via GitHub Actions.

Credits
-------
- **[Belonit](https://github.com/Belonit)** - Porting and adapting
- **[Kerbiter (Metadorius)](https://github.com/Metadorius)** - Further maintenance
- **[CnCNet](https://github.com/CnCNet) Contributors** - the [original spawner](https://github.com/CnCNet/yr-patches)
- **[Ares](https://github.com/Ares-Developers/Ares) and [Phobos](https://github.com/Phobos-developers/Phobos) Contributors** - [YRpp](https://github.com/Phobos-developers/yrpp) and [Syringe](https://github.com/Ares-Developers/Syringe) which are used and some code snippets

Expand Down
Loading
Loading