Skip to content

Commit a6b2e46

Browse files
bcbuild-github-agentmicrosoft
andauthored
Deploying AL-Go from main (383330241ad5197bb44396441a2a5ace0c879d1f) to main (#70)
Deploying AL-Go from main (383330241ad5197bb44396441a2a5ace0c879d1f) to main Co-authored-by: microsoft <microsoft@users.noreply.github.com>
1 parent 0af8feb commit a6b2e46

23 files changed

+549
-150
lines changed

.AL-Go/cloudDevEnv.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Write-Host -ForegroundColor Yellow @'
2828
$webClient = New-Object System.Net.WebClient
2929
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
3030
$webClient.Encoding = [System.Text.Encoding]::UTF8
31-
$GitHubHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.1/Github-Helper.psm1'
31+
$GitHubHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.2/Github-Helper.psm1'
3232
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
3333
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
3434
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
35-
$ALGoHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.1/AL-Go-Helper.ps1'
35+
$ALGoHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.2/AL-Go-Helper.ps1'
3636
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
3737
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
3838
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)

.AL-Go/localDevEnv.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ Write-Host -ForegroundColor Yellow @'
3232
$webClient = New-Object System.Net.WebClient
3333
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
3434
$webClient.Encoding = [System.Text.Encoding]::UTF8
35-
$GitHubHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.1/Github-Helper.psm1'
35+
$GitHubHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.2/Github-Helper.psm1'
3636
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
3737
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
3838
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
39-
$ALGoHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.1/AL-Go-Helper.ps1'
39+
$ALGoHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v5.2/AL-Go-Helper.ps1'
4040
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
4141
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
4242
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)

.github/RELEASENOTES.copy.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
## v5.2
2+
3+
### Issues
4+
- Issue 1084 Automatic updates for AL-Go are failing when main branch requires Pull Request
5+
6+
### New Settings
7+
8+
- `PowerPlatformSolutionFolder`: Contains the name of the folder containing a PowerPlatform Solution (only one)
9+
- `DeployTo<environment>` now has two additional properties `companyId` is the Company Id from Business Central (for PowerPlatform connection) and `ppEnvironmentUrl` is the Url of the PowerPlatform environment to deploy to.
10+
11+
### New Actions
12+
13+
- `BuildPowerPlatform`: to build a PowerPlatform Solution
14+
- `DeployPowerPlatform`: to deploy a PowerPlatform Solution
15+
- `PullPowerPlatformChanges`: to pull changes made in PowerPlatform studio into the repository
16+
- `ReadPowerPlatformSettings`: to read settings and secrets for PowerPlatform deployment
17+
- `GetArtifactsForDeployment`: originally code from deploy.ps1 to retrieve artifacts for releases or builds - now as an action to read apps into a folder.
18+
19+
### New Workflows
20+
21+
- **Pull PowerPlatform Changes** for pulling changes from your PowerPlatform development environment into your AL-Go for GitHub repository
22+
- **Push PowerPlatform Changes** for pushing changes from your AL-Go for GitHub repository to your PowerPlatform development environment
23+
24+
> [!NOTE]
25+
> PowerPlatform workflows are only available in the PTE template and will be removed if no PowerPlatformSolutionFolder is defined in settings.
26+
27+
### New Scenarios (Documentation)
28+
29+
- [Connect your GitHub repository to Power Platform](https://github.com/microsoft/AL-Go/blob/main/Scenarios/SetupPowerPlatform.md)
30+
- [How to set up Service Principal for Power Platform](https://github.com/microsoft/AL-Go/blob/main/Scenarios/SetupServicePrincipalForPowerPlatform.md)
31+
- [Try one of the Business Central and Power Platform samples](https://github.com/microsoft/AL-Go/blob/main/Scenarios/TryPowerPlatformSamples.md)
32+
- [Publish To AppSource](https://github.com/microsoft/AL-Go/blob/main/Scenarios/PublishToAppSource.md)
33+
34+
> [!NOTE]
35+
> PowerPlatform functionality are only available in the PTE template.
36+
137
## v5.1
238

339
### Issues

.github/workflows/AddExistingAppOrTestApp.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
runs-on: [ windows-latest ]
4040
steps:
4141
- name: Dump Workflow Information
42-
uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v5.1
42+
uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v5.2
4343
with:
4444
shell: powershell
4545

@@ -48,27 +48,27 @@ jobs:
4848

4949
- name: Initialize the workflow
5050
id: init
51-
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v5.1
51+
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v5.2
5252
with:
5353
shell: powershell
5454
eventId: "DO0090"
5555

5656
- name: Read settings
57-
uses: microsoft/AL-Go-Actions/ReadSettings@v5.1
57+
uses: microsoft/AL-Go-Actions/ReadSettings@v5.2
5858
with:
5959
shell: powershell
6060

6161
- name: Read secrets
6262
id: ReadSecrets
63-
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.1
63+
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.2
6464
with:
6565
shell: powershell
6666
gitHubSecrets: ${{ toJson(secrets) }}
6767
getSecrets: 'TokenForPush'
6868
useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}'
6969

7070
- name: Add existing app
71-
uses: microsoft/AL-Go-Actions/AddExistingApp@v5.1
71+
uses: microsoft/AL-Go-Actions/AddExistingApp@v5.2
7272
with:
7373
shell: powershell
7474
token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
@@ -79,7 +79,7 @@ jobs:
7979

8080
- name: Finalize the workflow
8181
if: always()
82-
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v5.1
82+
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v5.2
8383
with:
8484
shell: powershell
8585
eventId: "DO0090"

.github/workflows/CICD.yaml

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ jobs:
4040
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
4141
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
4242
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
43+
powerPlatformSolutionFolder: ${{ steps.DeterminePowerPlatformSolutionFolder.outputs.powerPlatformSolutionFolder }}
4344
workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }}
4445
steps:
4546
- name: Dump Workflow Information
46-
uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v5.1
47+
uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v5.2
4748
with:
4849
shell: powershell
4950

@@ -54,17 +55,17 @@ jobs:
5455

5556
- name: Initialize the workflow
5657
id: init
57-
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v5.1
58+
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v5.2
5859
with:
5960
shell: powershell
6061
eventId: "DO0091"
6162

6263
- name: Read settings
6364
id: ReadSettings
64-
uses: microsoft/AL-Go-Actions/ReadSettings@v5.1
65+
uses: microsoft/AL-Go-Actions/ReadSettings@v5.2
6566
with:
6667
shell: powershell
67-
get: type
68+
get: type, powerPlatformSolutionFolder
6869

6970
- name: Determine Workflow Depth
7071
id: DetermineWorkflowDepth
@@ -73,30 +74,36 @@ jobs:
7374
7475
- name: Determine Projects To Build
7576
id: determineProjectsToBuild
76-
uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v5.1
77+
uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v5.2
7778
with:
7879
shell: powershell
7980
maxBuildDepth: ${{ env.workflowDepth }}
8081

82+
- name: Determine PowerPlatform Solution Folder
83+
id: DeterminePowerPlatformSolutionFolder
84+
if: env.type == 'PTE'
85+
run: |
86+
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "powerPlatformSolutionFolder=$($env:powerPlatformSolutionFolder)"
87+
8188
- name: Determine Delivery Target Secrets
8289
id: DetermineDeliveryTargetSecrets
83-
uses: microsoft/AL-Go-Actions/DetermineDeliveryTargets@v5.1
90+
uses: microsoft/AL-Go-Actions/DetermineDeliveryTargets@v5.2
8491
with:
8592
shell: powershell
8693
projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}'
8794
checkContextSecrets: 'false'
8895

8996
- name: Read secrets
9097
id: ReadSecrets
91-
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.1
98+
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.2
9299
with:
93100
shell: powershell
94101
gitHubSecrets: ${{ toJson(secrets) }}
95102
getSecrets: ${{ steps.DetermineDeliveryTargetSecrets.outputs.ContextSecrets }}
96103

97104
- name: Determine Delivery Targets
98105
id: DetermineDeliveryTargets
99-
uses: microsoft/AL-Go-Actions/DetermineDeliveryTargets@v5.1
106+
uses: microsoft/AL-Go-Actions/DetermineDeliveryTargets@v5.2
100107
env:
101108
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
102109
with:
@@ -106,7 +113,7 @@ jobs:
106113

107114
- name: Determine Deployment Environments
108115
id: DetermineDeploymentEnvironments
109-
uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v5.1
116+
uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v5.2
110117
env:
111118
GITHUB_TOKEN: ${{ github.token }}
112119
with:
@@ -122,13 +129,13 @@ jobs:
122129
uses: actions/checkout@v4
123130

124131
- name: Read settings
125-
uses: microsoft/AL-Go-Actions/ReadSettings@v5.1
132+
uses: microsoft/AL-Go-Actions/ReadSettings@v5.2
126133
with:
127134
shell: powershell
128135
get: templateUrl
129136

130137
- name: Check for updates to AL-Go system files
131-
uses: microsoft/AL-Go-Actions/CheckForUpdates@v5.1
138+
uses: microsoft/AL-Go-Actions/CheckForUpdates@v5.2
132139
with:
133140
shell: powershell
134141
templateUrl: ${{ env.templateUrl }}
@@ -158,9 +165,23 @@ jobs:
158165
signArtifacts: true
159166
useArtifactCache: true
160167

168+
BuildPP:
169+
needs: [ Initialization ]
170+
if: (!failure()) && (!cancelled()) && needs.Initialization.outputs.powerPlatformSolutionFolder != ''
171+
name: Build PowerPlatform Solution
172+
uses: ./.github/workflows/_BuildPowerPlatformSolution.yaml
173+
secrets: inherit
174+
with:
175+
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
176+
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
177+
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
178+
project: ${{ needs.Initialization.outputs.powerPlatformSolutionFolder }}
179+
projectName: ${{ needs.Initialization.outputs.powerPlatformSolutionFolder }}
180+
publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || startswith(github.ref_name, 'releases/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }}
181+
161182
DeployALDoc:
162183
needs: [ Initialization, Build ]
163-
if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main'
184+
if: (!cancelled()) && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main'
164185
runs-on: windows-latest
165186
name: Deploy Reference Documentation
166187
permissions:
@@ -181,7 +202,7 @@ jobs:
181202
path: '.artifacts'
182203

183204
- name: Read settings
184-
uses: microsoft/AL-Go-Actions/ReadSettings@v5.1
205+
uses: microsoft/AL-Go-Actions/ReadSettings@v5.2
185206
with:
186207
shell: powershell
187208

@@ -190,7 +211,7 @@ jobs:
190211
uses: actions/configure-pages@v5
191212

192213
- name: Build Reference Documentation
193-
uses: microsoft/AL-Go-Actions/BuildReferenceDocumentation@v5.1
214+
uses: microsoft/AL-Go-Actions/BuildReferenceDocumentation@v5.2
194215
with:
195216
shell: powershell
196217
artifacts: '.artifacts'
@@ -206,8 +227,8 @@ jobs:
206227
uses: actions/deploy-pages@v4
207228

208229
Deploy:
209-
needs: [ Initialization, Build ]
210-
if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.environmentCount > 0
230+
needs: [ Initialization, Build, BuildPP ]
231+
if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && (needs.BuildPP.result == 'success' || needs.BuildPP.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0
211232
strategy: ${{ fromJson(needs.Initialization.outputs.environmentsMatrixJson) }}
212233
runs-on: ${{ fromJson(matrix.os) }}
213234
name: Deploy to ${{ matrix.environment }}
@@ -227,9 +248,10 @@ jobs:
227248
path: '.artifacts'
228249

229250
- name: Read settings
230-
uses: microsoft/AL-Go-Actions/ReadSettings@v5.1
251+
uses: microsoft/AL-Go-Actions/ReadSettings@v5.2
231252
with:
232253
shell: ${{ matrix.shell }}
254+
get: type,powerPlatformSolutionFolder
233255

234256
- name: EnvName
235257
id: envName
@@ -240,27 +262,38 @@ jobs:
240262
241263
- name: Read secrets
242264
id: ReadSecrets
243-
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.1
265+
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.2
244266
with:
245267
shell: ${{ matrix.shell }}
246268
gitHubSecrets: ${{ toJson(secrets) }}
247269
getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext,${{ steps.envName.outputs.envName }}-EnvironmentName,${{ steps.envName.outputs.envName }}_EnvironmentName,EnvironmentName,projects'
248270

249-
- name: Deploy
271+
- name: Deploy to Business Central
250272
id: Deploy
251-
uses: microsoft/AL-Go-Actions/Deploy@v5.1
273+
uses: microsoft/AL-Go-Actions/Deploy@v5.2
252274
env:
253275
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
254276
with:
255277
shell: ${{ matrix.shell }}
256278
environmentName: ${{ matrix.environment }}
257-
artifacts: '.artifacts'
279+
artifactsFolder: '.artifacts'
258280
type: 'CD'
259281
deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }}
260282

283+
- name: Deploy to Power Platform
284+
if: env.type == 'PTE' && env.powerPlatformSolutionFolder != ''
285+
uses: microsoft/AL-Go-Actions/DeployPowerPlatform@v5.2
286+
env:
287+
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
288+
with:
289+
shell: powershell
290+
environmentName: ${{ matrix.environment }}
291+
artifactsFolder: '.artifacts'
292+
deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }}
293+
261294
Deliver:
262-
needs: [ Initialization, Build ]
263-
if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.deliveryTargetsJson != '[]'
295+
needs: [ Initialization, Build, BuildPP ]
296+
if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && (needs.BuildPP.result == 'success' || needs.BuildPP.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]'
264297
strategy:
265298
matrix:
266299
deliveryTarget: ${{ fromJson(needs.Initialization.outputs.deliveryTargetsJson) }}
@@ -277,20 +310,20 @@ jobs:
277310
path: '.artifacts'
278311

279312
- name: Read settings
280-
uses: microsoft/AL-Go-Actions/ReadSettings@v5.1
313+
uses: microsoft/AL-Go-Actions/ReadSettings@v5.2
281314
with:
282315
shell: powershell
283316

284317
- name: Read secrets
285318
id: ReadSecrets
286-
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.1
319+
uses: microsoft/AL-Go-Actions/ReadSecrets@v5.2
287320
with:
288321
shell: powershell
289322
gitHubSecrets: ${{ toJson(secrets) }}
290323
getSecrets: '${{ matrix.deliveryTarget }}Context'
291324

292325
- name: Deliver
293-
uses: microsoft/AL-Go-Actions/Deliver@v5.1
326+
uses: microsoft/AL-Go-Actions/Deliver@v5.2
294327
env:
295328
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
296329
with:
@@ -301,7 +334,7 @@ jobs:
301334
artifacts: '.artifacts'
302335

303336
PostProcess:
304-
needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc ]
337+
needs: [ Initialization, Build, BuildPP, Deploy, Deliver, DeployALDoc ]
305338
if: (!cancelled())
306339
runs-on: [ windows-latest ]
307340
steps:
@@ -310,7 +343,7 @@ jobs:
310343

311344
- name: Finalize the workflow
312345
id: PostProcess
313-
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v5.1
346+
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v5.2
314347
with:
315348
shell: powershell
316349
eventId: "DO0091"

0 commit comments

Comments
 (0)