Skip to content

Commit c8606f3

Browse files
authored
Restructure and cleanup a lot of the repo, include private parts as a submodule (#31)
* Restructure and cleanup a lot of the repo, include private parts as a submodule * Move repo checkout out of the custom build action because it is not available without checkout bruh * Adjust metadata * Change release build upload to be triggered when the release is actually created * Fixup readme a bit * Checkout merged commit of private stuff
1 parent 606cd05 commit c8606f3

38 files changed

+295
-200
lines changed

.github/actions/build/action.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
artifact-name:
1212
description: "Artifact file name"
1313
required: false
14-
default: compiled-dll-${{ github.sha }}
14+
default: ''
1515

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

3333
- name: Upload Artifact
34-
if: ${{ success() }}
34+
if: ${{ success() && inputs.artifact-name != '' }}
3535
uses: actions/upload-artifact@v4
3636
with:
3737
name: ${{ inputs.artifact-name }}
3838
path: |
3939
${{inputs.sln-path}}/${{inputs.build-config}}/CnCNet-Spawner.dll
4040
${{inputs.sln-path}}/${{inputs.build-config}}/CnCNet-Spawner.pdb
41-
./LICENSE.md
42-
./README.md

.github/workflows/nightly-build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,28 @@ on:
44
push:
55
branches:
66
- main
7+
- master
78
- develop
8-
9-
env:
10-
SOLUTION_PATH: .
11-
BUILD_CONFIGURATION: DevBuild
9+
pull_request:
1210

1311
jobs:
1412
build:
1513
runs-on: windows-2019
1614

15+
strategy:
16+
matrix:
17+
build-type: [DevBuild] # [Debug, DevBuild, Release]
18+
is-cncnet-yr: ['', -CnCNetYR]
19+
is-hardened: ['', -Hardened]
20+
1721
steps:
1822
- uses: actions/checkout@v4
1923
with:
2024
submodules: recursive
25+
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}
2126

2227
- name: Build
2328
uses: ./.github/actions/build
2429
with:
25-
sln-path: ${{ env.SOLUTION_PATH }}
26-
build-config: ${{ env.BUILD_CONFIGURATION }}
27-
artifact-name: compiled-dll-regular-${{ github.sha }}
28-
29-
- name: Build HardEnd
30-
uses: ./.github/actions/build
31-
with:
32-
sln-path: ${{ env.SOLUTION_PATH }}
33-
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
34-
artifact-name: compiled-dll-hardend-${{ github.sha }}
30+
build-config: ${{ matrix.build-type }}${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}
31+
artifact-name: spawner${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}-${{ github.sha }}

.github/workflows/pr-nightly-build.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/pr-nightly-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Nightly Build Comment on Pull Request"
22
on:
33
workflow_run:
4-
workflows: ['Pull Request Nightly Build']
4+
workflows: ['Nightly Build']
55
types: [completed]
66
jobs:
77
pr_comment:
Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,40 @@
11
name: "Release Build"
22

33
on:
4-
push:
5-
tags:
6-
- "v*.*.*.*"
4+
release:
5+
types: [published]
76

87
env:
9-
RELEASE_NAME: ${{ github.ref_name }}
10-
ARTIFACT_NAME: CnCNet-Spawner_${{ github.ref_name }}
11-
12-
SOLUTION_PATH: .
13-
BUILD_CONFIGURATION: Release
8+
BUILD_CONFIG: ${{ matrix.build-type }}${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}
9+
ARCHIVE_NAME: CnCNet-Spawner${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}-${{ github.ref_name }}.zip
1410

1511
jobs:
1612
build:
1713
runs-on: windows-2019
1814

15+
strategy:
16+
matrix:
17+
build-type: [Release] # [Debug, DevBuild, Release]
18+
is-cncnet-yr: ['', -CnCNetYR]
19+
is-hardened: ['', -Hardened]
20+
1921
steps:
2022
- uses: actions/checkout@v4
2123
with:
2224
submodules: recursive
25+
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}
2326

2427
- name: Build
2528
uses: ./.github/actions/build
2629
with:
27-
sln-path: ${{ env.SOLUTION_PATH }}
28-
build-config: ${{ env.BUILD_CONFIGURATION }}
29-
artifact-name: compiled-dll-regular-${{ github.sha }}
30-
31-
- name: Build HardEnd
32-
uses: ./.github/actions/build
33-
with:
34-
sln-path: ${{ env.SOLUTION_PATH }}
35-
build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd
36-
artifact-name: compiled-dll-hardend-${{ github.sha }}
30+
build-config: ${{ env.BUILD_CONFIG }}
3731

38-
- name: Create Archive For Release
39-
run: |
40-
mkdir ./artifact
41-
mkdir ./artifact/Regular
42-
copy ./LICENSE.md ./artifact/Regular/LICENSE.md
43-
copy ./README.md ./artifact/Regular/README.md
44-
copy ./${{ env.BUILD_CONFIGURATION }}/CnCNet-Spawner.pdb ./artifact/Regular/CnCNet-Spawner.pdb
45-
copy ./${{ env.BUILD_CONFIGURATION }}/CnCNet-Spawner.dll ./artifact/Regular/CnCNet-Spawner.dll
46-
7z a ${{ env.ARTIFACT_NAME }}.zip ./artifact/Regular/*
47-
mkdir ./artifact/HardEnd
48-
copy ./LICENSE.md ./artifact/HardEnd/LICENSE.md
49-
copy ./README.md ./artifact/HardEnd/README.md
50-
copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/CnCNet-Spawner.pdb" ./artifact/HardEnd/CnCNet-Spawner.pdb
51-
copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/CnCNet-Spawner.dll" ./artifact/HardEnd/CnCNet-Spawner.dll
52-
7z a ${{ env.ARTIFACT_NAME }}-HardEnd.zip ./artifact/HardEnd/*
32+
- name: Create an Archive for the Release
33+
run: 7z a ${{ env.ARCHIVE_NAME }}.zip ./LICENSE.md ./${{ env.BUILD_CONFIG }}/CnCNet-Spawner.dll ./${{ env.BUILD_CONFIG }}/CnCNet-Spawner.pdb
5334

54-
- name: Upload New Release
35+
- name: Upload Files to the Release
5536
uses: softprops/action-gh-release@v2
5637
with:
57-
name: ${{ env.RELEASE_NAME }}
58-
tag_name: ${{ env.RELEASE_NAME }}
59-
body: ${{ env.RELEASE_NAME }}
6038
append_body: true
61-
draft: true
62-
files: |
63-
${{ env.ARTIFACT_NAME }}.zip
64-
${{ env.ARTIFACT_NAME }}-HardEnd.zip
39+
files: ${{ env.ARCHIVE_NAME }}
6540

66-
request-anti-cheat-build:
67-
needs: [build]
68-
runs-on: ubuntu-latest
69-
steps:
70-
- name: Request AntiCheat Build
71-
run: |
72-
curl -L \
73-
-X POST \
74-
-H "Accept: application/vnd.github+json" \
75-
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
76-
-H "X-GitHub-Api-Version: 2022-11-28" \
77-
https://api.github.com/repos/cncnet/yrpp-spawner-private/actions/workflows/release-build-by-request.yml/dispatches \
78-
-d '{"ref":"main", "inputs":{"tag": "${{ github.ref_name }}"}}'

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
yrpp-spawner-private/
22
Release/**
3+
Release-Hardened/**
34
DevBuild/**
5+
DevBuild-Hardened/**
46
Debug/**
5-
Release-HardEnd/**
6-
DevBuild-HardEnd/**
7-
Debug-HardEnd/**
7+
Debug-Hardened/**
8+
Release-CnCNetYR/**
9+
Release-CnCNetYR-Hardened/**
10+
DevBuild-CnCNetYR/**
11+
DevBuild-CnCNetYR-Hardened/**
12+
Debug-CnCNetYR/**
13+
Debug-CnCNetYR-Hardened/**
814

915
.vs/**
1016
.vscode/**

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "YRpp"]
22
path = YRpp
33
url = [email protected]:CnCNet/YRpp.git
4+
[submodule "Private"]
5+
path = Private
6+
url = [email protected]:CnCNet/yrpp-spawner-private.git

.vscode/tasks.json

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"label": "Build debug build",
7+
"label": "Build",
88
"type": "process",
99
"command": [],
1010
"windows": {
11-
"command": "scripts/build_debug.bat"
11+
"command": "scripts/build.bat",
12+
"args": [
13+
"${input:buildType}${input:isCnCNetYR}${input:isHardened}"
14+
]
1215
},
1316
"group": {
1417
"kind": "build",
1518
"isDefault": true
1619
},
1720
"problemMatcher": "$msCompile"
1821
},
19-
{
20-
"label": "Build release build",
21-
"type": "process",
22-
"command": [],
23-
"windows": {
24-
"command": "scripts/build_release.bat"
25-
},
26-
"group": "build",
27-
"problemMatcher": "$msCompile"
28-
},
2922
{
3023
"label": "Cleanup build folders",
3124
"type": "process",
@@ -65,5 +58,56 @@
6558
"showReuseMessage": false
6659
}
6760
}
61+
],
62+
"inputs": [
63+
{
64+
"id": "buildType",
65+
"type": "pickString",
66+
"options": [
67+
{
68+
"value": "Debug"
69+
},
70+
{
71+
"value": "DevBuild"
72+
},
73+
{
74+
"value": "Release"
75+
}
76+
],
77+
"default": "Debug",
78+
"description": "Select the build type"
79+
},
80+
{
81+
"id": "isCnCNetYR",
82+
"type": "pickString",
83+
"options": [
84+
{
85+
"value": "",
86+
"label": "No"
87+
},
88+
{
89+
"value": "-CnCNetYR",
90+
"label": "Yes"
91+
}
92+
],
93+
"default": "",
94+
"description": "Is this a CnCNet YR build?"
95+
},
96+
{
97+
"id": "isHardened",
98+
"type": "pickString",
99+
"options": [
100+
{
101+
"value": "",
102+
"label": "No"
103+
},
104+
{
105+
"value": "-Hardened",
106+
"label": "Yes"
107+
}
108+
],
109+
"default": "",
110+
"description": "Is this a hardened build? (Enables additional security features)"
111+
}
68112
]
69113
}

Private

Submodule Private added at b2461ce

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ Downloads
55
Building manually
66
-----------------
77

8-
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.
9-
2. Clone this repo recursively via your favorite git client (that will also clone YRpp).
8+
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.
9+
2. Clone this repo recursively via your favorite git client (that will also clone YRpp and private submodule, if you have access).
1010
3. To build the extension:
1111
- in Visual Studio: open the solution file in VS and build it (`Debug` build config is recommended);
12-
- in VSCode: open the project folder and hit `Run Build Task...` (`Ctrl + Shift + B`);
13-
- barebones: run `scripts/build_debug.bat`.
12+
- in VSCode: open the project folder, hit `Run Build Task...` (`Ctrl + Shift + B`) and select the needed config;
13+
- barebones: run the corresponding `scripts/build_*.bat`.
1414
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.
1515

16+
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.
17+
1618
Credits
1719
-------
1820
- **[Belonit](https://github.com/Belonit)** - Porting and adapting
21+
- **[Kerbiter (Metadorius)](https://github.com/Metadorius)** - Further maintenance
1922
- **[CnCNet](https://github.com/CnCNet) Contributors** - the [original spawner](https://github.com/CnCNet/yr-patches)
2023
- **[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
2124

0 commit comments

Comments
 (0)