-
-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (82 loc) · 2.6 KB
/
Copy pathmain.yml
File metadata and controls
97 lines (82 loc) · 2.6 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
96
97
name: Build AuthKit Server
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
DOTNET_VERSION: '10.0.x'
SOLUTION_FILE: 'AuthKit.slnx'
HOST_PROJECT: 'src/Host/Host.csproj'
jobs:
build:
name: Build on ${{ matrix.os }} (${{ matrix.runtime }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
runtime: linux-x64
- os: windows-latest
runtime: win-x64
- os: macos-latest
runtime: osx-x64
outputs:
artifact-name: ${{ steps.set-artifact-name.outputs.name }}
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: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore ${{ env.SOLUTION_FILE }}
- name: Build solution
run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Release --no-restore
- name: Publish application
run: dotnet publish ${{ env.HOST_PROJECT }} --configuration Release --runtime ${{ matrix.runtime }} --self-contained false --output ./publish/${{ matrix.runtime }}
- name: Set artifact name output
id: set-artifact-name
run: echo "name=auth-service-${{ matrix.runtime }}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: auth-service-${{ matrix.runtime }}
path: ./publish/${{ matrix.runtime }}
attest:
name: Attest Build Provenance
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./publish
- name: Attest build provenance
uses: actions/attest-build-provenance@v3
with:
subject-path: ./publish