Skip to content

Commit

Permalink
Merge pull request #17 from BusinessCentralApps/update-al-go-system-f…
Browse files Browse the repository at this point in the history
…iles/main/231205083144

Updated AL-Go System Files
  • Loading branch information
freddydk authored Dec 5, 2023
2 parents 988c9d3 + 6fd6a07 commit 626353c
Show file tree
Hide file tree
Showing 23 changed files with 705 additions and 453 deletions.
2 changes: 1 addition & 1 deletion .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "PTE",
"templateUrl": "https://github.com/freddydk/AL-Go@main",
"templateUrl": "https://github.com/freddydk/AL-Go@bcptreport",
"runs-on": "bc-build",
"BcContainerHelperVersion": "preview",
"GenerateDependencyArtifact": true,
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/AddExistingAppOrTestApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ on:
description: Direct Download Url of .app or .zip file
required: true
directCommit:
description: Direct COMMIT (Y/N)
required: false
default: 'N'
description: Direct Commit?
type: boolean
default: false
useGhTokenWorkflow:
description: Use GhTokenWorkflow for Pull Request/COMMIT
description: Use GhTokenWorkflow for PR/Commit?
type: boolean
default: false

permissions:
contents: write
Expand All @@ -34,34 +35,40 @@ env:

jobs:
AddExistingAppOrTestApp:
needs: [ ]
runs-on: [ bc-build ]
steps:
- name: Dump Workflow Information
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport
with:
shell: powershell

- name: Checkout
uses: actions/checkout@v3

- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@main
uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport
with:
shell: powershell
eventId: "DO0090"

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

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@main
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
with:
shell: powershell
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: 'TokenForPush'
useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}'

- name: Add existing app
uses: freddydk/AL-Go/Actions/AddExistingApp@main
uses: freddydk/AL-Go/Actions/AddExistingApp@bcptreport
with:
shell: powershell
token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
Expand All @@ -72,7 +79,7 @@ jobs:

- name: Finalize the workflow
if: always()
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport
with:
shell: powershell
eventId: "DO0090"
Expand Down
99 changes: 78 additions & 21 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ env:

jobs:
Initialization:
needs: [ ]
runs-on: [ bc-build ]
outputs:
telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
environmentsMatrixJson: ${{ steps.DetermineDeploymentEnvironments.outputs.EnvironmentsMatrixJson }}
environmentCount: ${{ steps.DetermineDeploymentEnvironments.outputs.EnvironmentCount }}
deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.DeploymentEnvironmentsJson }}
generateALDocArtifact: ${{ steps.DetermineDeploymentEnvironments.outputs.GenerateALDocArtifact }}
deployALDocArtifact: ${{ steps.DetermineDeploymentEnvironments.outputs.DeployALDocArtifact }}
deliveryTargetsJson: ${{ steps.DetermineDeliveryTargets.outputs.DeliveryTargetsJson }}
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
Expand All @@ -38,21 +41,26 @@ jobs:
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }}
steps:
- name: Dump Workflow Information
uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport
with:
shell: powershell

- name: Checkout
uses: actions/checkout@v3
with:
lfs: true

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

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

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

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

- name: Determine Delivery Targets
id: DetermineDeliveryTargets
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@main
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@bcptreport
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
shell: powershell
projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}'
checkContextSecrets: 'Y'
checkContextSecrets: 'true'

- name: Determine Deployment Environments
id: DetermineDeploymentEnvironments
uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@main
uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@bcptreport
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand All @@ -106,24 +114,24 @@ jobs:
type: 'CD'

CheckForUpdates:
runs-on: [ bc-build ]
needs: [ Initialization ]
runs-on: [ bc-build ]
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Check for updates to AL-Go system files
uses: freddydk/AL-Go/Actions/CheckForUpdates@main
uses: freddydk/AL-Go/Actions/CheckForUpdates@bcptreport
with:
shell: powershell
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
templateUrl: ${{ env.templateUrl }}
downloadLatest: true

Build:
needs: [ Initialization ]
Expand All @@ -149,6 +157,53 @@ jobs:
signArtifacts: true
useArtifactCache: true

DeployALDoc:
needs: [ Initialization, Build ]
if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main'
runs-on: windows-latest
name: Deploy Reference Documentation
permissions:
contents: write
actions: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: '.artifacts'

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

- name: Setup Pages
if: needs.Initialization.outputs.deployALDocArtifact == 1
uses: actions/configure-pages@v3

- name: Build Reference Documentation
uses: freddydk/AL-Go/Actions/BuildReferenceDocumentation@bcptreport
with:
shell: powershell
artifacts: '.artifacts'

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ".aldoc/_site/"

- name: Deploy to GitHub Pages
if: needs.Initialization.outputs.deployALDocArtifact == 1
id: deployment
uses: actions/deploy-pages@v2

Deploy:
needs: [ Initialization, Build ]
if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.environmentCount > 0
Expand All @@ -157,6 +212,7 @@ jobs:
name: Deploy to ${{ matrix.environment }}
environment:
name: ${{ matrix.environment }}
url: ${{ steps.Deploy.outputs.environmentUrl }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -167,7 +223,7 @@ jobs:
path: '.artifacts'

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

Expand All @@ -180,14 +236,15 @@ jobs:
- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@main
uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport
with:
shell: powershell
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
uses: freddydk/AL-Go/Actions/Deploy@main
id: Deploy
uses: freddydk/AL-Go/Actions/Deploy@bcptreport
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand Down Expand Up @@ -216,20 +273,20 @@ jobs:
path: '.artifacts'

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

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

- name: Deliver
uses: freddydk/AL-Go/Actions/Deliver@main
uses: freddydk/AL-Go/Actions/Deliver@bcptreport
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand All @@ -240,16 +297,16 @@ jobs:
artifacts: '.artifacts'

PostProcess:
needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc ]
if: (!cancelled())
runs-on: [ bc-build ]
needs: [ Initialization, Build, Deploy, Deliver ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Finalize the workflow
id: PostProcess
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport
with:
shell: powershell
eventId: "DO0091"
Expand Down
Loading

0 comments on commit 626353c

Please sign in to comment.