Skip to content

Commit

Permalink
Update AL-Go System Files
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Dec 18, 2023
1 parent f20e332 commit bc5af2f
Show file tree
Hide file tree
Showing 17 changed files with 125 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .AL-Go/cloudDevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Write-Host -ForegroundColor Yellow @'
$webClient = New-Object System.Net.WebClient
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
$webClient.Encoding = [System.Text.Encoding]::UTF8
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1'
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/Github-Helper.psm1'
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1'
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1'
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)
Expand Down
4 changes: 2 additions & 2 deletions .AL-Go/localDevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Write-Host -ForegroundColor Yellow @'
$webClient = New-Object System.Net.WebClient
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
$webClient.Encoding = [System.Text.Encoding]::UTF8
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1'
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/Github-Helper.psm1'
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1'
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1'
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)
Expand Down
4 changes: 2 additions & 2 deletions .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "AppSource App",
"templateUrl": "https://github.com/freddydk/AL-Go@bcptreport",
"templateUrl": "https://github.com/freddydk/AL-Go@nuget",
"NextMajorSchedule": "0 2 * * 0",
"NextMinorSchedule": "0 2 * * 6",
"CurrentSchedule": "0 2 * * 1,2,3,4,5",
Expand All @@ -12,5 +12,5 @@
"CreatePerformanceTestApp.yaml"
],
"BcContainerHelperVersion": "latest",
"templateSha": "10f98f2810aebb6f5ca54180a2d794ee24d7f15f"
"templateSha": "679d5cf17e51b1cd558453f429df6e59bf2ce95c"
}
38 changes: 19 additions & 19 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }}
steps:
- name: Dump Workflow Information
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@nuget
with:
shell: pwsh

Expand All @@ -53,14 +53,14 @@ jobs:

- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport
uses: freddydk/AL-Go/Actions/WorkflowInitialize@nuget
with:
shell: pwsh
eventId: "DO0091"

- name: Read settings
id: ReadSettings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh
get: type
Expand All @@ -72,30 +72,30 @@ jobs:
- name: Determine Projects To Build
id: determineProjectsToBuild
uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport
uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@nuget
with:
shell: pwsh
maxBuildDepth: ${{ env.workflowDepth }}

- name: Determine Delivery Target Secrets
id: DetermineDeliveryTargetSecrets
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@bcptreport
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@nuget
with:
shell: pwsh
projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}'
checkContextSecrets: 'false'

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: ${{ steps.DetermineDeliveryTargetSecrets.outputs.ContextSecrets }}

- name: Determine Delivery Targets
id: DetermineDeliveryTargets
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@bcptreport
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@nuget
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand All @@ -105,7 +105,7 @@ jobs:

- name: Determine Deployment Environments
id: DetermineDeploymentEnvironments
uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@bcptreport
uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@nuget
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand All @@ -121,13 +121,13 @@ jobs:
uses: actions/checkout@v3

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh
get: templateUrl

- name: Check for updates to AL-Go system files
uses: freddydk/AL-Go/Actions/CheckForUpdates@bcptreport
uses: freddydk/AL-Go/Actions/CheckForUpdates@nuget
with:
shell: pwsh
templateUrl: ${{ env.templateUrl }}
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
path: '.artifacts'

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

Expand All @@ -189,7 +189,7 @@ jobs:
uses: actions/configure-pages@v3

- name: Build Reference Documentation
uses: freddydk/AL-Go/Actions/BuildReferenceDocumentation@bcptreport
uses: freddydk/AL-Go/Actions/BuildReferenceDocumentation@nuget
with:
shell: pwsh
artifacts: '.artifacts'
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
path: '.artifacts'

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

Expand All @@ -236,15 +236,15 @@ jobs:
- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext,${{ steps.envName.outputs.envName }}-EnvironmentName,${{ steps.envName.outputs.envName }}_EnvironmentName,EnvironmentName,projects'

- name: Deploy
id: Deploy
uses: freddydk/AL-Go/Actions/Deploy@bcptreport
uses: freddydk/AL-Go/Actions/Deploy@nuget
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand Down Expand Up @@ -273,20 +273,20 @@ jobs:
path: '.artifacts'

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: '${{ matrix.deliveryTarget }}Context'

- name: Deliver
uses: freddydk/AL-Go/Actions/Deliver@bcptreport
uses: freddydk/AL-Go/Actions/Deliver@nuget
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand All @@ -306,7 +306,7 @@ jobs:

- name: Finalize the workflow
id: PostProcess
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@nuget
with:
shell: pwsh
eventId: "DO0091"
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/CreateOnlineDevelopmentEnvironment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
steps:
- name: Dump Workflow Information
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@nuget
with:
shell: pwsh

Expand All @@ -57,20 +57,20 @@ jobs:

- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport
uses: freddydk/AL-Go/Actions/WorkflowInitialize@nuget
with:
shell: pwsh
eventId: "DO0093"

- name: Read settings
id: ReadSettings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
Expand All @@ -83,17 +83,17 @@ jobs:
$settings = $env:Settings | ConvertFrom-Json
if ('${{ fromJson(steps.ReadSecrets.outputs.Secrets).adminCenterApiCredentials }}') {
Write-Host "AdminCenterApiCredentials provided in secret $($settings.adminCenterApiCredentialsSecretName)!"
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "Admin Center Api Credentials was provided in a secret called $($settings.adminCenterApiCredentialsSecretName). Using this information for authentication."
Set-Content -Path $ENV:GITHUB_STEP_SUMMARY -value "Admin Center Api Credentials was provided in a secret called $($settings.adminCenterApiCredentialsSecretName). Using this information for authentication."
}
else {
Write-Host "AdminCenterApiCredentials not provided, initiating Device Code flow"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient = New-Object System.Net.WebClient
$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1', $ALGoHelperPath)
$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1', $ALGoHelperPath)
. $ALGoHelperPath
DownloadAndImportBcContainerHelper
$authContext = New-BcAuthContext -includeDeviceLogin -deviceLoginTimeout ([TimeSpan]::FromSeconds(0))
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "AL-Go needs access to the Business Central Admin Center Api and could not locate a secret called $($settings.adminCenterApiCredentialsSecretName) (https://aka.ms/ALGoSettings#AdminCenterApiCredentialsSecretName)`n`n$($authContext.message)"
Set-Content -Path $ENV:GITHUB_STEP_SUMMARY -value "AL-Go needs access to the Business Central Admin Center Api and could not locate a secret called $($settings.adminCenterApiCredentialsSecretName) (https://aka.ms/ALGoSettings#AdminCenterApiCredentialsSecretName)`n`n$($authContext.message)"
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "deviceCode=$($authContext.deviceCode)"
}
Expand All @@ -111,13 +111,13 @@ jobs:
uses: actions/checkout@v3

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
Expand All @@ -136,7 +136,7 @@ jobs:
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -value "adminCenterApiCredentials=$adminCenterApiCredentials"
- name: Create Development Environment
uses: freddydk/AL-Go/Actions/CreateDevelopmentEnvironment@bcptreport
uses: freddydk/AL-Go/Actions/CreateDevelopmentEnvironment@nuget
with:
shell: pwsh
token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
Expand All @@ -149,7 +149,7 @@ jobs:

- name: Finalize the workflow
if: always()
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@nuget
with:
shell: pwsh
eventId: "DO0093"
Expand Down
Loading

0 comments on commit bc5af2f

Please sign in to comment.