Skip to content

Commit 01fbe1e

Browse files
bcbuild-github-agentmicrosoft
bcbuild-github-agent
and
microsoft
authored
Deploying AL-Go from main (37e4e3fac9276ad13dc998d03f7bf0fdad577d19) to main (microsoft#29)
Deploying AL-Go from main (37e4e3fac9276ad13dc998d03f7bf0fdad577d19) to main Co-authored-by: microsoft <[email protected]>
1 parent 9584936 commit 01fbe1e

22 files changed

+362
-666
lines changed

.AL-Go/cloudDevEnv.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ $webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumen
1717
$webClient.Encoding = [System.Text.Encoding]::UTF8
1818
Write-Host "Downloading GitHub Helper module"
1919
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
20-
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.2/Github-Helper.psm1', $GitHubHelperPath)
20+
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.3/Github-Helper.psm1', $GitHubHelperPath)
2121
Write-Host "Downloading AL-Go Helper script"
2222
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
23-
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.2/AL-Go-Helper.ps1', $ALGoHelperPath)
23+
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.3/AL-Go-Helper.ps1', $ALGoHelperPath)
2424

2525
Import-Module $GitHubHelperPath
2626
. $ALGoHelperPath -local
@@ -31,13 +31,13 @@ $project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot
3131
Clear-Host
3232
Write-Host
3333
Write-Host -ForegroundColor Yellow @'
34-
_____ _ _ _____ ______
35-
/ ____| | | | | __ \ | ____|
34+
_____ _ _ _____ ______
35+
/ ____| | | | | __ \ | ____|
3636
| | | | ___ _ _ __| | | | | | _____ __ |__ _ ____ __
3737
| | | |/ _ \| | | |/ _` | | | | |/ _ \ \ / / __| | '_ \ \ / /
38-
| |____| | (_) | |_| | (_| | | |__| | __/\ V /| |____| | | \ V /
39-
\_____|_|\___/ \__,_|\__,_| |_____/ \___| \_/ |______|_| |_|\_/
40-
38+
| |____| | (_) | |_| | (_| | | |__| | __/\ V /| |____| | | \ V /
39+
\_____|_|\___/ \__,_|\__,_| |_____/ \___| \_/ |______|_| |_|\_/
40+
4141
'@
4242

4343
Write-Host @'
@@ -51,8 +51,6 @@ if (Test-Path (Join-Path $PSScriptRoot "NewBcContainer.ps1")) {
5151
Write-Host -ForegroundColor Red "WARNING: The project has a NewBcContainer override defined. Typically, this means that you cannot run a cloud development environment"
5252
}
5353

54-
$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME
55-
5654
Write-Host
5755

5856
if (-not $environmentName) {

.AL-Go/localDevEnv.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ $webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumen
2020
$webClient.Encoding = [System.Text.Encoding]::UTF8
2121
Write-Host "Downloading GitHub Helper module"
2222
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
23-
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.2/Github-Helper.psm1', $GitHubHelperPath)
23+
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.3/Github-Helper.psm1', $GitHubHelperPath)
2424
Write-Host "Downloading AL-Go Helper script"
2525
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
26-
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.2/AL-Go-Helper.ps1', $ALGoHelperPath)
26+
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v3.3/AL-Go-Helper.ps1', $ALGoHelperPath)
2727

2828
Import-Module $GitHubHelperPath
2929
. $ALGoHelperPath -local
@@ -34,13 +34,13 @@ $project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot
3434
Clear-Host
3535
Write-Host
3636
Write-Host -ForegroundColor Yellow @'
37-
_ _ _____ ______
38-
| | | | | __ \ | ____|
37+
_ _ _____ ______
38+
| | | | | __ \ | ____|
3939
| | ___ ___ __ _| | | | | | _____ __ |__ _ ____ __
4040
| | / _ \ / __/ _` | | | | | |/ _ \ \ / / __| | '_ \ \ / /
41-
| |____ (_) | (__ (_| | | | |__| | __/\ V /| |____| | | \ V /
42-
|______\___/ \___\__,_|_| |_____/ \___| \_/ |______|_| |_|\_/
43-
41+
| |____ (_) | (__ (_| | | | |__| | __/\ V /| |____| | | \ V /
42+
|______\___/ \___\__,_|_| |_____/ \___| \_/ |______|_| |_|\_/
43+
4444
'@
4545

4646
Write-Host @'

.github/RELEASENOTES.copy.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
## v3.3
2+
3+
### Issues
4+
5+
- Issue 227 Feature request: Allow deployments with "Schema Sync Mode" = Force
6+
- Issue 519 Deploying to onprem environment
7+
- Issue 520 Automatic deployment to environment with annotation
8+
- Issue 592 Internal Server Error when publishing
9+
- Issue 557 Deployment step fails when retried
10+
- After configuring deployment branches for an environment in GitHub and setting Deployment Branch Policy to **Protected Branches**, AL-Go for GitHub would fail during initialization (trying to get environments for deployment)
11+
- The DetermineDeploymentEnvironments doesn't work in private repositories (needs the GITHUB_TOKEN)
12+
- Issue 683 Settings from GitHub variables ALGoRepoSettings and ALGoOrgSettings are not applied during build pipeline
13+
- Issue 708 Inconsistent AuthTokenSecret Behavior in Multiple Projects: 'Secrets are not available'
14+
15+
### Breaking changes
16+
17+
Earlier, you could specify a mapping to an environment name in an environment secret called `<environmentname>_EnvironmentName`, `<environmentname>-EnvironmentName` or just `EnvironmentName`. You could also specify the projects you want to deploy to an environment as an environment secret called `Projects`.
18+
19+
This mechanism is no longer supported and you will get an error if your repository has these secrets. Instead you should use the `DeployTo<environmentName>` setting described below.
20+
21+
Earlier, you could also specify the projects you want to deploy to an environment in a setting called `<environmentName>_Projects` or `<environmentName>-Projects`. This is also no longer supported. Instead use the `DeployTo<environmentName>` and remove the old settings.
22+
23+
### New Actions
24+
- `DetermineDeliveryTargets`: Determine which delivery targets should be used for delivering artifacts from the build job.
25+
- `DetermineDeploymentEnvironments`: Determine which deployment environments should be used for the workflow.
26+
27+
### New Settings
28+
- `projectName`: project setting used as friendly name for an AL-Go project, to be used in the UI for various workflows, e.g. CICD, Pull Request Build.
29+
- `fullBuildPatterns`: used by `DetermineProjectsToBuild` action to specify changes in which files and folders would trigger a full build (building all AL-Go projects).
30+
- `excludeEnvironments`: used by `DetermineDeploymentEnvironments` action to exclude environments from the list of environments considered for deployment.
31+
- `deployTo<environmentName>`: is not really new, but has new properties. The complete list of properties is here:
32+
- **EnvironmentType** = specifies the type of environment. The environment type can be used to invoke a custom deployment. (Default SaaS)
33+
- **EnvironmentName** = specifies the "real" name of the environment if it differs from the GitHub environment
34+
- **Branches** = an array of branch patterns, which are allowed to deploy to this environment. (Default [ "main" ])
35+
- **Projects** = In multi-project repositories, this property can be a comma separated list of project patterns to deploy to this environment. (Default *)
36+
- **SyncMode** = ForceSync if deployment to this environment should happen with ForceSync, else Add. If deploying to the development endpoint you can also specify Development or Clean. (Default Add)
37+
- **ContinuousDeployment** = true if this environment should be used for continuous deployment, else false. (Default: AL-Go will continuously deploy to sandbox environments or environments, which doesn't end in (PROD) or (FAT)
38+
- **runs-on** = specifies which GitHub runner to use when deploying to this environment. (Default is settings.runs-on)
39+
40+
### Custom Deployment
41+
42+
By specifying a custom EnvironmentType in the DeployTo structure for an environment, you can now add a script in the .github folder called `DeployTo<environmentType>.ps1`. This script will be executed instead of the standard deployment mechanism with the following parameters in a HashTable:
43+
44+
| Parameter | Description | Example |
45+
| --------- | :--- | :--- |
46+
| `$parameters.type` | Type of delivery (CD or Release) | CD |
47+
| `$parameters.apps` | Apps to deploy | /home/runner/.../GHP-Common-main-Apps-2.0.33.0.zip |
48+
| `$parameters.EnvironmentType` | Environment type | SaaS |
49+
| `$parameters.EnvironmentName` | Environment name | Production |
50+
| `$parameters.Branches` | Branches which should deploy to this environment (from settings) | main,dev |
51+
| `$parameters.AuthContext` | AuthContext in a compressed Json structure | {"refreshToken":"mytoken"} |
52+
| `$parameters.BranchesFromPolicy` | Branches which should deploy to this environment (from GitHub environments) | main |
53+
| `$parameters.Projects` | Projects to deploy to this environment | |
54+
| `$parameters.ContinuousDeployment` | Is this environment setup for continuous deployment | false |
55+
| `$parameters."runs-on"` | GitHub runner to be used to run the deployment script | windows-latest |
56+
57+
### Status Checks in Pull Requests
58+
59+
AL-Go for GitHub now adds status checks to Pull Requests Builds. In your GitHub branch protection rules, you can set up "Pull Request Status Check" to be a required status check to ensure Pull Request Builds succeed before merging.
60+
61+
### Secrets in AL-Go for GitHub
62+
In v3.2 of AL-Go for GitHub, all secrets requested by AL-Go for GitHub were available to all steps in a job one compressed JSON structure in env:Secrets.
63+
With this update, only the steps that actually requires secrets will have the secrets available.
64+
165
## v3.2
266

367
### Issues
@@ -65,13 +129,13 @@ All these actions now uses the selected branch in the **Run workflow** dialog as
65129

66130
### New Settings
67131

68-
- `UseCompilerFolder`: Setting useCompilerFolder to true causes your pipelines to use containerless compiling. Unless you also set `doNotPublishApps` to true, setting useCompilerFolder to true won't give you any performance advantage, since AL-Go for GitHub will still need to create a container in order to publish and test the apps. In the future, publishing and testing will be split from building and there will be other options for getting an instance of Business Central for publishing and testing.
132+
- `UseCompilerFolder`: Setting useCompilerFolder to true causes your pipelines to use containerless compiling. Unless you also set `doNotPublishApps` to true, setting useCompilerFolder to true won't give you any performance advantage, since AL-Go for GitHub will still need to create a container in order to publish and test the apps. In the future, publishing and testing will be split from building and there will be other options for getting an instance of Business Central for publishing and testing.
69133
- `vsixFile`: vsixFile should be a direct download URL to the version of the AL Language extension you want to use for building the project or repo. By default, AL-Go will use the AL Language extension that comes with the Business Central Artifacts.
70134

71135
### New Workflows
72136

73137
- **_BuildALGoProject** is a reusable workflow that unites the steps for building an AL-Go projects. It has been reused in the following workflows: _CI/CD_, _Pull Request Build_, _NextMinor_, _NextMajor_ and _Current_.
74-
The workflow appears under the _Actions_ tab in GitHub, but it is not actionable in any way.
138+
The workflow appears under the _Actions_ tab in GitHub, but it is not actionable in any way.
75139

76140
### New Actions
77141

@@ -208,7 +272,7 @@ Setting the repo setting "runs-on" to "Ubuntu-Latest", followed by running Updat
208272
- Issue #273 Potential security issue in Pull Request Handler in Open Source repositories
209273
- Issue #303 PullRequestHandler fails on added files
210274
- Issue #299 Multi-project repositories build all projects on Pull Requests
211-
- Issue #291 Issues with new Pull Request Handler
275+
- Issue #291 Issues with new Pull Request Handler
212276
- Issue #287 AL-Go pipeline fails in ReadSettings step
213277

214278
### Changes
@@ -323,7 +387,7 @@ Setting the repo setting "runs-on" to "Ubuntu-Latest", followed by running Updat
323387
```
324388
"ConditionalSettings": [
325389
{
326-
"branches": [
390+
"branches": [
327391
"feature/*"
328392
],
329393
"settings": {

.github/workflows/AddExistingAppOrTestApp.yaml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,57 +41,38 @@ jobs:
4141

4242
- name: Initialize the workflow
4343
id: init
44-
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v3.2
44+
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v3.3
4545
with:
4646
shell: powershell
4747
eventId: "DO0090"
4848

4949
- name: Read settings
50-
uses: microsoft/AL-Go-Actions/[email protected]
51-
if: github.event.inputs.useGhTokenWorkflow == 'true'
50+
uses: microsoft/AL-Go-Actions/[email protected]
5251
with:
5352
shell: powershell
54-
parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
5553

5654
- name: Read secrets
57-
uses: microsoft/AL-Go-Actions/ReadSecrets@v3.2
58-
if: github.event.inputs.useGhTokenWorkflow == 'true'
55+
id: ReadSecrets
56+
uses: microsoft/AL-Go-Actions/[email protected]
5957
with:
6058
shell: powershell
61-
parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
6259
gitHubSecrets: ${{ toJson(secrets) }}
63-
getSecrets: 'ghTokenWorkflow'
64-
65-
- name: CalculateToken
66-
id: CalculateToken
67-
env:
68-
useGhTokenWorkflow: ${{ github.event.inputs.useGhTokenWorkflow }}
69-
run: |
70-
$ghToken = '${{ secrets.GITHUB_TOKEN }}'
71-
if ($env:useGhTokenWorkflow -eq 'true') {
72-
$secrets = $env:Secrets | ConvertFrom-Json
73-
if ($secrets.GHTOKENWORKFLOW) {
74-
$ghToken = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($secrets.GHTOKENWORKFLOW))
75-
}
76-
else {
77-
Write-Host "::Warning::GHTOKENWORKFLOW secret not found. Using GITHUB_TOKEN."
78-
}
79-
}
80-
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "ghToken=$ghToken"
60+
getSecrets: 'TokenForPush'
61+
useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}'
8162

8263
- name: Add existing app
83-
uses: microsoft/AL-Go-Actions/AddExistingApp@v3.2
64+
uses: microsoft/AL-Go-Actions/AddExistingApp@v3.3
8465
with:
8566
shell: powershell
86-
token: ${{ steps.CalculateToken.outputs.ghToken }}
67+
token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
8768
parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
8869
project: ${{ github.event.inputs.project }}
8970
url: ${{ github.event.inputs.url }}
9071
directCommit: ${{ github.event.inputs.directCommit }}
9172

9273
- name: Finalize the workflow
9374
if: always()
94-
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v3.2
75+
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v3.3
9576
with:
9677
shell: powershell
9778
eventId: "DO0090"

0 commit comments

Comments
 (0)