-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 1.84 KB
/
build.yml
File metadata and controls
71 lines (60 loc) · 1.84 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
name: Build and Publish Plugin
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
publish_profile:
description: 'Publish profile to use'
required: true
type: choice
options:
- ReleaseNoReflectionPublish-O1
- ReleaseNoReflectionPublish-O2
- ReleasePublish-O1
- ReleasePublish-O2
- DebugPublish
- DebugNoReflectionPublish
default: ReleaseNoReflectionPublish-O1
permissions:
id-token: write
contents: read
attestations: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Set publish profile
shell: pwsh
run: |
if ($env:GITHUB_EVENT_NAME -eq 'workflow_dispatch') {
$profile = '${{ inputs.publish_profile }}'
} else {
$profile = 'ReleaseNoReflectionPublish-O1'
}
echo "PUBLISH_PROFILE=$profile" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Restore dependencies
run: dotnet restore Hi3Helper.Plugin.Wuwa.sln
- name: Build solution
run: dotnet build --configuration Release Hi3Helper.Plugin.Wuwa.sln --no-restore
- name: Publish with selected profile
run: dotnet publish Hi3Helper.Plugin.Wuwa/Hi3Helper.Plugin.Wuwa.csproj --configuration Release --runtime win-x64 /p:PublishProfile=$PUBLISH_PROFILE -o ./publish
- name: Generate build provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: './publish/**'
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: plugin-build
path: ./publish/