-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (85 loc) · 2.75 KB
/
build-plugins.yml
File metadata and controls
95 lines (85 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build Plugins
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
discover:
name: Discover plugins
runs-on: ubuntu-latest
outputs:
plugins: ${{ steps.compute.outputs.plugins }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
force_all:
- '.github/workflows/build-plugins.yml'
- 'Directory.Build.props'
- 'Directory.Build.targets'
- 'global.json'
- 'NuGet.config'
Deathmatch:
- 'Deathmatch/**'
LockTimer:
- 'LockTimer/**'
StatusPoker:
- 'StatusPoker/**'
TrooperInvasion:
- 'TrooperInvasion/**'
HeroSelect:
- 'HeroSelect/**'
HealOnSpawn:
- 'HealOnSpawn/**'
DisconnectCleanup:
- 'DisconnectCleanup/**'
HeroSelectOnNextSpawn:
- 'HeroSelectOnNextSpawn/**'
- name: Compute plugin matrix
id: compute
env:
FORCE_ALL: ${{ steps.filter.outputs.force_all }}
CHANGES: ${{ steps.filter.outputs.changes }}
run: |
set -euo pipefail
all_plugins=$(find . -name '*.csproj' -printf '%h\n' | sed 's|^\./||' | sort -u \
| jq -R -s -c 'split("\n") | map(select(. != ""))')
if [[ "$FORCE_ALL" == "true" ]]; then
plugins="$all_plugins"
else
tops=$(echo "$CHANGES" | jq -c '[.[] | select(. != "force_all")]')
plugins=$(echo "$all_plugins" | jq -c --argjson tops "$tops" \
'[.[] | select((. | split("/")[0]) as $top | $tops | index($top))]')
fi
echo "plugins=$plugins" >> "$GITHUB_OUTPUT"
echo "Building: $plugins"
build:
name: Build ${{ matrix.plugin }}
needs: discover
if: needs.discover.outputs.plugins != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plugin: ${{ fromJson(needs.discover.outputs.plugins) }}
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "10.0.x"
- name: Download latest Deadworks release
run: |
gh release download --repo Deadworks-net/deadworks --pattern '*.zip' --output deadworks.zip
unzip -q deadworks.zip -d deadworks-framework
env:
GH_TOKEN: ${{ github.token }}
- name: Build ${{ matrix.plugin }}
run: |
dotnet build "${{ matrix.plugin }}" \
-p:DeadlockDir=${{ github.workspace }}/deadworks-framework \
-c Release \
--nologo