Repository navigation
73 lines (63 loc) · 2.18 KB
/
Copy pathplugin-validation.yml
File metadata and controls
73 lines (63 loc) · 2.18 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
name: Plugin Contract Validation
on:
push:
branches: [main, development]
tags: ['v*']
paths:
- 'src/Plugins/**'
- 'tools/AuthKit.PluginContractValidator/**'
- '.github/workflows/plugin-validation.yml'
pull_request:
branches: [main, development]
paths:
- 'src/Plugins/**'
- 'tools/AuthKit.PluginContractValidator/**'
- '.github/workflows/plugin-validation.yml'
workflow_dispatch:
env:
DOTNET_VERSION: '10.0.x'
VALIDATOR_PROJECT: 'tools/AuthKit.PluginContractValidator/AuthKit.PluginContractValidator.csproj'
PLUGINS_STAGING: 'out/plugins'
permissions:
contents: read
jobs:
validate:
name: Validate Plugin Contracts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build plugin UIs
run: |
for pkg in $(find src/Plugins -name package.json -not -path '*/node_modules/*'); do
ui=$(dirname "$pkg")
echo "Building UI: $ui"
npm --prefix "$ui" ci
npm --prefix "$ui" run build
done
- name: Publish plugins
run: |
mkdir -p "${{ env.PLUGINS_STAGING }}"
for proj in $(find src/Plugins -name '*.csproj' \
-not -path '*/Abstractions/*' \
-not -path '*/Integrations/*' \
-not -path '*/obj/*' \
-not -path '*/bin/*'); do
name=$(basename "$proj" .csproj)
echo "Publishing plugin: $name"
dotnet publish "$proj" -c Release -o "${{ env.PLUGINS_STAGING }}/$name" --nologo
done
- name: Build contract validator
run: dotnet build "${{ env.VALIDATOR_PROJECT }}" -c Release --nologo
- name: Run contract validation
run: |
VALIDATOR_DLL="tools/AuthKit.PluginContractValidator/bin/Release/net10.0/AuthKit.PluginContractValidator.dll"
dotnet "$VALIDATOR_DLL" "${{ github.workspace }}/${{ env.PLUGINS_STAGING }}"