-
Notifications
You must be signed in to change notification settings - Fork 2
164 lines (147 loc) · 6.78 KB
/
NextMajor.yaml
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: ' Test Next Major'
on:
workflow_dispatch:
permissions:
actions: read
contents: read
id-token: write
defaults:
run:
shell: pwsh
env:
workflowDepth: 3
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}
jobs:
Initialization:
needs: [ ]
runs-on: [ ubuntu-latest ]
outputs:
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }}
artifactsRetentionDays: ${{ steps.DetermineWorkflowDepth.outputs.ArtifactsRetentionDays }}
telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
steps:
- name: Dump Workflow Information
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@thisbuild
with:
shell: pwsh
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: true
- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@thisbuild
with:
shell: pwsh
- name: Read settings
id: ReadSettings
uses: freddydk/AL-Go/Actions/ReadSettings@thisbuild
with:
shell: pwsh
get: useGitSubmodules,shortLivedArtifactsRetentionDays
- name: Read submodules token
id: ReadSubmodulesToken
if: env.useGitSubmodules != 'false' && env.useGitSubmodules != ''
uses: freddydk/AL-Go/Actions/ReadSecrets@thisbuild
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: '-gitSubmodulesToken'
- name: Checkout Submodules
if: env.useGitSubmodules != 'false' && env.useGitSubmodules != ''
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: true
submodules: ${{ env.useGitSubmodules }}
token: '${{ fromJson(steps.ReadSubmodulesToken.outputs.Secrets).gitSubmodulesToken }}'
- name: Determine Workflow Depth
id: DetermineWorkflowDepth
run: |
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "WorkflowDepth=$($env:workflowDepth)"
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "ArtifactsRetentionDays=$($env:shortLivedArtifactsRetentionDays)"
- name: Determine Projects To Build
id: determineProjectsToBuild
uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@thisbuild
with:
shell: pwsh
maxBuildDepth: ${{ env.workflowDepth }}
Build1:
needs: [ Initialization ]
if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[0].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ matrix.githubRunnerShell }}
runsOn: ${{ matrix.githubRunner }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }}
artifactsNameSuffix: 'NextMajor'
Build2:
needs: [ Initialization, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ matrix.githubRunnerShell }}
runsOn: ${{ matrix.githubRunner }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }}
artifactsNameSuffix: 'NextMajor'
Build:
needs: [ Initialization, Build2, Build1 ]
if: (!failure()) && (!cancelled()) && (needs.Build2.result == 'success' || needs.Build2.result == 'skipped') && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[2].projectsCount > 0
strategy:
matrix:
include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[2].buildDimensions }}
fail-fast: false
name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }})
uses: ./.github/workflows/_BuildALGoProject.yaml
secrets: inherit
with:
shell: ${{ matrix.githubRunnerShell }}
runsOn: ${{ matrix.githubRunner }}
project: ${{ matrix.project }}
projectName: ${{ matrix.projectName }}
buildMode: ${{ matrix.buildMode }}
projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }}
secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString'
artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }}
artifactsNameSuffix: 'NextMajor'
PostProcess:
needs: [ Initialization, Build2, Build1, Build ]
if: always()
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Finalize the workflow
id: PostProcess
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@thisbuild
env:
GITHUB_TOKEN: ${{ github.token }}
with:
shell: pwsh
telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
currentJobContext: ${{ toJson(job) }}