-
-
Notifications
You must be signed in to change notification settings - Fork 779
142 lines (125 loc) · 4.24 KB
/
Copy pathci.yml
File metadata and controls
142 lines (125 loc) · 4.24 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: "Build and Validate"
env:
CAKE_TARGET: "BuildAll"
CAKE_VERBOSITY: "Normal"
RELEASE_MODE: "Beta"
RUN_TESTS: "true"
permissions:
checks: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- "develop"
- "release/*"
pull_request:
branches:
- "develop"
- "release/*"
workflow_dispatch:
inputs:
CAKE_TARGET:
description: "Cake Target"
type: "string"
default: "BuildAll"
CAKE_VERBOSITY:
description: "Cake Verbosity"
type: "choice"
default: "Normal"
options:
- "Quiet"
- "Minimal"
- "Normal"
- "Verbose"
- "Diagnostic"
RELEASE_MODE:
description: "Release Mode"
type: "choice"
default: "Beta"
options:
- "Alpha"
- "Beta"
- "RC"
- "Stable"
RUN_TESTS:
description: "Run Tests?"
type: boolean
default: true
jobs:
build-and-validate:
name: "Build and Validate"
runs-on: "windows-2025-vs2026"
defaults:
run:
shell: "pwsh"
steps:
- name: "Setup Environment Variables"
run: |
"CAKE_TARGET=${{ inputs.CAKE_TARGET || env.CAKE_TARGET }}" >> $env:GITHUB_ENV;
"CAKE_VERBOSITY=${{ inputs.CAKE_VERBOSITY || env.CAKE_VERBOSITY }}" >> $env:GITHUB_ENV;
"RELEASE_MODE=${{ inputs.RELEASE_MODE || env.RELEASE_MODE }}" >> $env:GITHUB_ENV;
"RUN_TESTS=${{ inputs.RUN_TESTS || env.RUN_TESTS }}" >> $env:GITHUB_ENV;
- name: "Checkout"
uses: "actions/checkout@v6.0.2"
# Built-in caching is broken for Yarn, using setup-node twice
# See https://github.com/actions/setup-node/issues/531#issuecomment-3335630863
- name: "Setup Node.js"
uses: "actions/setup-node@v6.3.0"
with:
node-version-file: ".node-version"
package-manager-cache: false
- name: "Enable Corepack"
run: "corepack enable"
- name: "Setup Yarn cache"
uses: "actions/setup-node@v6.3.0"
with:
cache: "yarn"
- name: "Setup .NET SDK"
uses: "actions/setup-dotnet@v5.2.0"
with:
global-json-file: "global.json"
- name: "Initialize Git User"
run: |
git config --global user.email 'noreply@dnncommunity.org';
git config --global user.name 'DNN Platform CI Bot';
- name: "Update Alpha/Beta/Stable flag"
run: |
$path = '.\DNN Platform\Library\Properties\AssemblyInfo.cs'
$pattern3 = '\[assembly: AssemblyStatus'
(Get-Content $path) | ForEach-Object {
if ($_ -match $pattern3) {
# We have found the matching line
'[assembly: AssemblyStatus(ReleaseMode.{0})]' -f '${{ env.RELEASE_MODE }}'
} else {
$_
}
} | Set-Content $path
- name: "Run DNN Build via Cake"
run: "./build.ps1 --target=${{ env.CAKE_TARGET }} --verbosity=${{ env.CAKE_VERBOSITY }}"
- name: "Run Unit Tests via Cake"
if: ${{ env.RUN_TESTS == 'true' }}
run: "./build.ps1 --target=UnitTests --verbosity=${{ env.CAKE_VERBOSITY }}"
continue-on-error: true
- name: "Publish Test Results"
uses: "EnricoMi/publish-unit-test-result-action/windows@v2.23.0"
if: ${{ !cancelled() && env.RUN_TESTS == 'true' }}
with:
files: "**/TestResults/*.trx"
action_fail: true
- name: "Publish Artifacts"
uses: "actions/upload-artifact@v7.0.0"
if: ${{ !cancelled() }}
with:
path: "Artifacts"
if-no-files-found: "error"
compression-level: "0"
overwrite: true
- name: "Create GitHub Pull Request"
if: ${{ success() && !contains('pull_request', github.event_name) && (contains(fromJSON('["develop", "main"]'), github.ref_name) || startsWith('release/', github.ref_name)) }}
run: "./build.ps1 --target=CreateGitHubPullRequest --verbosity=${{ env.CAKE_VERBOSITY }}"
env:
GITHUB_APP_ID: ${{ secrets.GITHUB_APP_ID }}
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}