Skip to content

Commit ee657af

Browse files
committed
Merge branch 'development'
2 parents ad005d1 + ae878b0 commit ee657af

File tree

95 files changed

+14572
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+14572
-308
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NWN_VERSION=8193.34
2+
NWNX_VERSION=790a54b

.github/workflows/ci.yml

Lines changed: 97 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,21 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v2
30+
with:
31+
submodules: recursive
3032

3133
- name: Check Line Endings
3234
uses: erclu/check-crlf@v1
35+
with:
36+
path: NWN.Anvil
3337

3438
- name: Setup .NET Core
3539
uses: actions/setup-dotnet@v1
3640
with:
3741
dotnet-version: 5.0.100
3842

3943
- name: Build
40-
run: dotnet build --configuration Release /warnaserror
44+
run: dotnet build --configuration Release
4145

4246
- name: Prepare Outputs
4347
id: vars
@@ -64,10 +68,61 @@ jobs:
6468
run: |
6569
! grep "<Issue TypeId=" results.xml
6670
71+
test:
72+
runs-on: ubuntu-20.04
73+
if: "!contains(github.event.head_commit.message, 'skip ci')"
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v2
77+
with:
78+
submodules: recursive
79+
80+
- name: Setup .NET Core
81+
uses: actions/setup-dotnet@v1
82+
with:
83+
dotnet-version: 5.0.100
84+
85+
- name: Build
86+
run: dotnet build --configuration Release
87+
88+
- name: Run Tests
89+
run: docker-compose --env-file ../../../.env up
90+
working-directory: NWN.Anvil.Tests/bin/Release/
91+
92+
- name: Install NUnit
93+
run: |
94+
nuget install NUnit.Console -Version 3.12.0
95+
96+
- name: Fetch transform code
97+
run: |
98+
wget https://raw.githubusercontent.com/nunit/nunit-transforms/master/nunit3-junit/nunit3-junit.xslt
99+
shell: bash
100+
101+
- name: Transform NUnit3 to JUnit
102+
run: |
103+
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform;
104+
$xslt.Load("nunit3-junit.xslt");
105+
$xslt.Transform("NWN.Anvil.Tests/bin/Release/results/NWN.Anvil.Tests/TestResult.xml", "TestResult.junit.xml");
106+
shell: pwsh
107+
108+
- name: Upload Event File
109+
uses: actions/upload-artifact@v2
110+
if: always()
111+
with:
112+
name: Event File
113+
path: ${{ github.event_path }}
114+
115+
- name: Upload Results
116+
uses: actions/upload-artifact@v2
117+
if: always()
118+
with:
119+
name: Test Results
120+
path: TestResult.junit.xml
121+
67122
build:
68123
runs-on: ubuntu-20.04
69124
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
70-
needs: compile
125+
needs: [compile, test]
71126
outputs:
72127
version: ${{ steps.vars.outputs.version }}
73128
tag: ${{ steps.vars.outputs.tag }}
@@ -79,6 +134,7 @@ jobs:
79134
uses: actions/checkout@v2
80135
with:
81136
fetch-depth: 0
137+
submodules: recursive
82138

83139
- name: Setup .NET Core
84140
uses: actions/setup-dotnet@v1
@@ -102,29 +158,46 @@ jobs:
102158
META=`echo $DESCRIBE | awk '{split($0,a,"-"); print a[2]}'`
103159
BUILD=`echo $DESCRIBE | awk '{split($0,a,"-"); print a[3]}'`
104160
COMMIT=`echo $DESCRIBE | awk '{split($0,a,"-"); print a[4]}'`
105-
echo "::set-output name=version::$(echo ${VERSION}-${META}.${BUILD}.${COMMIT:1} | sed 's/^v//')"
161+
echo "::set-output name=version::$(echo ${VERSION}-${META}.${BUILD}.r${COMMIT:1} | sed 's/^v//')"
106162
fi
107163
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
108164
echo "::set-output name=image_repository::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
109165
110166
- name: Build Release Binaries
111167
id: build
112168
run: |
113-
dotnet build --configuration Release -p:Version=${{ steps.vars.outputs.version }} -o output
169+
dotnet build --configuration Release -p:Version=${{ steps.vars.outputs.version }}
114170
echo "::set-output name=created::$(echo date -u +'%Y-%m-%dT%H:%M:%SZ')"
115171
116172
- name: Upload NuGet Artifacts
117173
uses: actions/upload-artifact@v2
118174
with:
119-
name: nuget-binaries
120-
path: output/
175+
name: NuGet Packages
176+
path: |
177+
NWN.Anvil/bin/Release/*.nupkg
178+
NWN.Anvil/bin/Release/*.snupkg
179+
NWN.Anvil.TestRunner/bin/Release/NWN.Anvil.TestRunner/*.nupkg
180+
NWN.Anvil.TestRunner/bin/Release/NWN.Anvil.TestRunner/*.snupkg
121181
if-no-files-found: error
122182

123-
- name: Upload Build Artifacts
183+
- name: Upload Build Artifacts (Anvil)
124184
uses: actions/upload-artifact@v2
125185
with:
126-
name: binaries
127-
path: NWN.Anvil.zip
186+
name: Binaries
187+
path: |
188+
NWN.Anvil/bin/Release/
189+
!NWN.Anvil/bin/Release/*.nupkg
190+
!NWN.Anvil/bin/Release/*.snupkg
191+
if-no-files-found: error
192+
193+
- name: Upload Build Artifacts (Test Runner)
194+
uses: actions/upload-artifact@v2
195+
with:
196+
name: Binaries (Test Runner)
197+
path: |
198+
NWN.Anvil.TestRunner/bin/Release/
199+
!NWN.Anvil.TestRunner/bin/Release/NWN.Anvil.TestRunner/*.nupkg
200+
!NWN.Anvil.TestRunner/bin/Release/NWN.Anvil.TestRunner/*.snupkg
128201
if-no-files-found: error
129202

130203
release:
@@ -135,7 +208,12 @@ jobs:
135208
- name: Download Release Artifacts
136209
uses: actions/download-artifact@v2
137210
with:
138-
name: binaries
211+
name: Binaries
212+
path: binaries
213+
214+
- name: Zip Binaries
215+
run: zip -r ../NWN.Anvil.zip ./*
216+
working-directory: binaries
139217

140218
- name: Create Release
141219
id: create_release
@@ -172,14 +250,14 @@ jobs:
172250
- name: Download Release Artifacts
173251
uses: actions/download-artifact@v2
174252
with:
175-
name: nuget-binaries
176-
path: output
253+
name: NuGet Packages
254+
path: binaries
177255

178256
- name: NuGet Publish
179-
run: dotnet nuget push output/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
257+
run: dotnet nuget push 'binaries/**/*.nupkg' --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
180258

181259
- name: GitHub Publish
182-
run: dotnet nuget push output/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/nwn-dotnet/index.json
260+
run: dotnet nuget push 'binaries/**/*.nupkg' --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/nwn-dotnet/index.json
183261

184262
docker:
185263
runs-on: ubuntu-20.04
@@ -188,15 +266,14 @@ jobs:
188266
steps:
189267
- name: Checkout
190268
uses: actions/checkout@v2
269+
with:
270+
submodules: recursive
191271

192272
- name: Download Release Artifacts
193273
uses: actions/download-artifact@v2
194274
with:
195-
name: nuget-binaries
196-
path: output
197-
198-
- name: Remove NuGet packages
199-
run: rm output/*nupkg
275+
name: Binaries
276+
path: binaries
200277

201278
- name: Login to DockerHub
202279
uses: docker/login-action@v1
@@ -218,7 +295,7 @@ jobs:
218295
context: ./
219296
file: ./dockerfile
220297
push: true
221-
build-args: BINARY_PATH=/output
298+
build-args: BINARY_PATH=/binaries
222299
labels: |
223300
org.opencontainers.image.title=Anvil
224301
org.opencontainers.image.description=Anvil is a C# library that attempts to wrap Neverwinter Script with C# niceties and contexts, instead of a collection of functions. This image contains a NWNX server configured to use Anvil.

.github/workflows/test-report.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Test Results
2+
3+
on:
4+
workflow_run:
5+
workflows: ['Continuous Integration']
6+
types:
7+
- completed
8+
9+
jobs:
10+
test-results:
11+
name: Test Results
12+
runs-on: ubuntu-20.04
13+
if: github.event.workflow_run.conclusion != 'skipped'
14+
15+
steps:
16+
- name: Download and Extract Artifacts
17+
env:
18+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
19+
run: |
20+
mkdir -p artifacts && cd artifacts
21+
22+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
23+
24+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
25+
do
26+
IFS=$'\t' read name url <<< "$artifact"
27+
gh api $url > "$name.zip"
28+
unzip -d "$name" "$name.zip"
29+
done
30+
31+
- name: Publish Test Results
32+
uses: EnricoMi/publish-unit-test-result-action@v1.25
33+
with:
34+
check_name: "Test Results"
35+
comment_title: "Test Results"
36+
report_individual_runs: true
37+
commit: ${{ github.event.workflow_run.head_sha }}
38+
event_file: artifacts/Event File/event.json
39+
event_name: ${{ github.event.workflow_run.event }}
40+
files: "artifacts/Test Results/**/*.xml"

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "NWN.Anvil.TestRunner/src/lib/nunit"]
2+
path = NWN.Anvil.TestRunner/src/lib/nunit
3+
url = https://github.com/nwn-dotnet/nunit.git

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,43 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6+
## 8193.34.1
7+
https://github.com/nwn-dotnet/Anvil/compare/v8193.34.0...v8193.34.1
8+
9+
### Added
10+
- NwPlayer: `IsConnected` boolean added. Should be checked when enumerating `NwModule.Players`
11+
- NwPlayer: Added `DMPossessCreature` and `UnpossessCreature` for controlling player creature.
12+
- NwPlayer: `ForceExamine` now supports creatures, placeables, items and doors.
13+
- Implemented `NWN.Anvil.TestRunner` for running automated tests.
14+
- NwPlayer: Added `Get/SetPersonalVisibilityOverride` methods for customizing object visibility per player.
15+
- NwGameObject: Added `VisibilityOverride` property for customizing object visibility globally.
16+
- Creature Events: Added `OnCreatureCheckProficiencies` event.
17+
- Added `Local/Campaign/PersistentVariableEnum<T>` object variable type for user enum types. The underlying type must be an integer.
18+
- NwGameObject: Added `Clone` method for cloning non-creature and item objects.
19+
- NwDoor: Added `Create` method for creating doors from ResRefs.
20+
- NwEncounter: Added `Create` method for creating encounters from ResRefs.
21+
- NwSound: Added `Create` method for creating sound objects from ResRefs.
22+
- NwTrigger: Added `Create` method for creating triggers from ResRefs.
23+
- NWN.Anvil.TestRunner: Added generator for generating ResRef constants from the standard creator palette.
24+
25+
### Package Updates
26+
- NWN.Core: 8193.34.0 -> 8193.34.1
27+
28+
### Changed
29+
- `NwCreature.WalkRateCap` and `NwCreature.AlwaysWalk` properties are no-longer persistent. Additionally, the services and functions are not hooked until the associated property is used for the first time.
30+
- `NwObject.ObjectId` is now public.
31+
32+
### Deprecated
33+
- N/A
34+
35+
### Removed
36+
- N/A
37+
38+
### Fixed
39+
- `AnvilCore.Reload()` now uses the scheduler service to schedule the reload. This should fix some edge cases where async methods would hold a reference preventing unload.
40+
- Fixed an issue where the `SchedulerService` would throw an exception if the server was shutdown/reloaded during a schedule callback.
41+
- Fixed a rare crash when subscribed to effect events.
42+
643
## 8193.34.0
744
https://github.com/nwn-dotnet/Anvil/compare/v8193.33.5...v8193.34.0
845

0 commit comments

Comments
 (0)