From 51025e266cfea57104d8b76e384c8a68bb489246 Mon Sep 17 00:00:00 2001 From: NovoaDev Date: Mon, 1 Jul 2024 00:19:01 +0000 Subject: [PATCH] [main] Update AL-Go System Files - 81cff3d03e8fe6b88ee3fc0848594bfd4d9039a4 --- .github/AL-Go-Settings.json | 2 +- .github/workflows/CICD.yaml | 24 +--- .../workflows/PullPowerPlatformChanges.yaml | 108 ------------------ .../workflows/PushPowerPlatformChanges.yaml | 97 ---------------- .../_BuildPowerPlatformSolution.yaml | 96 ---------------- 5 files changed, 6 insertions(+), 321 deletions(-) delete mode 100644 .github/workflows/PullPowerPlatformChanges.yaml delete mode 100644 .github/workflows/PushPowerPlatformChanges.yaml delete mode 100644 .github/workflows/_BuildPowerPlatformSolution.yaml diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index 571dc78..08212f7 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -4,5 +4,5 @@ "nextMinorSchedule": "0 0 15 * *", "UpdateGitHubGoSystemFilesSchedule": "0 0 1,15 * *", "templateUrl": "https://github.com/microsoft/AL-Go-PTE@main", - "templateSha": "a6b2e468579e02a31a9cc9a2ae178a1e6beadf00" + "templateSha": "81cff3d03e8fe6b88ee3fc0848594bfd4d9039a4" } diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index af7e1d2..84d1e4d 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -165,20 +165,6 @@ jobs: signArtifacts: true useArtifactCache: true - BuildPP: - needs: [ Initialization ] - if: (!failure()) && (!cancelled()) && needs.Initialization.outputs.powerPlatformSolutionFolder != '' - name: Build PowerPlatform Solution - uses: ./.github/workflows/_BuildPowerPlatformSolution.yaml - secrets: inherit - with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} - project: ${{ needs.Initialization.outputs.powerPlatformSolutionFolder }} - projectName: ${{ needs.Initialization.outputs.powerPlatformSolutionFolder }} - publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || startswith(github.ref_name, 'releases/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }} - DeployALDoc: needs: [ Initialization, Build ] if: (!cancelled()) && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main' @@ -227,8 +213,8 @@ jobs: uses: actions/deploy-pages@v4 Deploy: - needs: [ Initialization, Build, BuildPP ] - if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && (needs.BuildPP.result == 'success' || needs.BuildPP.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0 + needs: [ Initialization, Build ] + if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0 strategy: ${{ fromJson(needs.Initialization.outputs.environmentsMatrixJson) }} runs-on: ${{ fromJson(matrix.os) }} name: Deploy to ${{ matrix.environment }} @@ -292,8 +278,8 @@ jobs: deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} Deliver: - needs: [ Initialization, Build, BuildPP ] - if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && (needs.BuildPP.result == 'success' || needs.BuildPP.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]' + needs: [ Initialization, Build ] + if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]' strategy: matrix: deliveryTarget: ${{ fromJson(needs.Initialization.outputs.deliveryTargetsJson) }} @@ -334,7 +320,7 @@ jobs: artifacts: '.artifacts' PostProcess: - needs: [ Initialization, Build, BuildPP, Deploy, Deliver, DeployALDoc ] + needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc ] if: (!cancelled()) runs-on: [ windows-latest ] steps: diff --git a/.github/workflows/PullPowerPlatformChanges.yaml b/.github/workflows/PullPowerPlatformChanges.yaml deleted file mode 100644 index ac32a0a..0000000 --- a/.github/workflows/PullPowerPlatformChanges.yaml +++ /dev/null @@ -1,108 +0,0 @@ -name: ' Pull Power Platform changes' - -on: - workflow_dispatch: - inputs: - environment: - description: Environment to pull changes from - required: true - solutionFolder: - description: Folder name of the Power Platform solution (leave empty to use AL-Go setting) - required: false - directCommit: - description: Direct Commit? - type: boolean - default: false - useGhTokenWorkflow: - description: Use GhTokenWorkflow for PR/Commit? - type: boolean - default: false - -permissions: - contents: write - pull-requests: write - -defaults: - run: - shell: powershell - -jobs: - PullChanges: - runs-on: [windows-latest] - name: Pull changes from ${{ inputs.environment }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Initialize the workflow - id: init - uses: microsoft/AL-Go-Actions/WorkflowInitialize@v5.2 - with: - shell: powershell - eventId: "DO0103" - - - name: EnvName - env: - _environment: ${{ inputs.environment }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $envName = "$env:_environment".Split(' ')[0] - Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "envName=$envName" - - - name: Read settings - uses: microsoft/AL-Go-Actions/ReadSettings@v5.2 - with: - shell: powershell - get: powerPlatformSolutionFolder - - - name: Read secrets - id: ReadSecrets - uses: microsoft/AL-Go-Actions/ReadSecrets@v5.2 - with: - shell: powershell - gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: '${{ env.envName }}-AuthContext,${{ env.envName }}_AuthContext,AuthContext,TokenForPush' - useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - - - name: Determine Deployment Environments - id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v5.2 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - shell: powershell - getEnvironments: ${{ inputs.environment }} - type: 'All' - - - name: Set Power Platform solution folder - env: - _solutionFolder: ${{ inputs.solutionFolder }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $solutionFolder = $env:_solutionFolder - if ($solutionFolder -eq '') { - Write-Host "Solution folder is not provided. Taking the folder from AL-Go settings" - $solutionFolder = $env:powerPlatformSolutionFolder - } - Write-Host "Solution folder: $solutionFolder" - Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "solutionFolder=$solutionFolder" - - - name: Pull changes from Power Platform environment - uses: microsoft/AL-Go-Actions/PullPowerPlatformChanges@v5.2 - env: - Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' - with: - shell: powershell - token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - directCommit: ${{ inputs.directCommit }} - environmentName: ${{ inputs.environment }} - solutionFolder: ${{ env.solutionFolder }} - deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.deploymentEnvironmentsJson }} - - - name: Finalize the workflow - if: always() - uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v5.2 - with: - shell: powershell - eventId: "DO0103" - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} diff --git a/.github/workflows/PushPowerPlatformChanges.yaml b/.github/workflows/PushPowerPlatformChanges.yaml deleted file mode 100644 index 4090c8b..0000000 --- a/.github/workflows/PushPowerPlatformChanges.yaml +++ /dev/null @@ -1,97 +0,0 @@ -name: " Push Power Platform changes" - -on: - workflow_dispatch: - inputs: - environment: - description: Environment to push changes to - required: true - solutionFolder: - description: Folder name of the Power Platform solution (leave empty to use AL-Go setting) - required: false - -permissions: - contents: read - -defaults: - run: - shell: powershell - -jobs: - PushChanges: - runs-on: [windows-latest] - name: Push changes to ${{ inputs.environment }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Initialize the workflow - id: init - uses: microsoft/AL-Go-Actions/WorkflowInitialize@v5.2 - with: - shell: powershell - eventId: "DO0103" - - - name: EnvName - env: - _environment: ${{ inputs.environment }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - # Environment names can contains spaces and tags (like (PROD) etc. We need to remove them to get the correct environment name) - $envName = "$env:_environment".Split(' ')[0] - Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "envName=$envName" - - - name: Read settings - uses: microsoft/AL-Go-Actions/ReadSettings@v5.2 - with: - shell: powershell - get: powerPlatformSolutionFolder - - - name: Read secrets - id: ReadSecrets - uses: microsoft/AL-Go-Actions/ReadSecrets@v5.2 - with: - shell: powershell - gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: '${{ env.envName }}-AuthContext,${{ env.envName }}_AuthContext,AuthContext' - - - name: Determine Deployment Environments - id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v5.2 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - shell: powershell - getEnvironments: ${{ inputs.environment }} - type: 'All' - - - name: Set Power Platform solution folder - env: - _solutionFolder: ${{ inputs.solutionFolder }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $solutionFolder = $env:_solutionFolder - if ($solutionFolder -eq '') { - Write-Host "Solution folder is not provided. Taking the folder from AL-Go settings" - $solutionFolder = $env:powerPlatformSolutionFolder - } - Write-Host "Solution folder: $solutionFolder" - Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "solutionFolder=$solutionFolder" - - - name: Export and push changes to Power Platform - uses: microsoft/AL-Go-Actions/DeployPowerPlatform@v5.2 - env: - Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' - with: - shell: powershell - environmentName: ${{ inputs.environment }} - solutionFolder: ${{ env.solutionFolder }} - deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.deploymentEnvironmentsJson }} - - - name: Finalize the workflow - if: always() - uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v5.2 - with: - shell: powershell - eventId: "DO0103" - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} diff --git a/.github/workflows/_BuildPowerPlatformSolution.yaml b/.github/workflows/_BuildPowerPlatformSolution.yaml deleted file mode 100644 index e5ebbb0..0000000 --- a/.github/workflows/_BuildPowerPlatformSolution.yaml +++ /dev/null @@ -1,96 +0,0 @@ -name: '_Build PowerPlatform Solution' - -run-name: 'Build PowerPlatform Solution' - -on: - workflow_call: - inputs: - shell: - description: Shell in which you want to run the action (powershell or pwsh) - required: false - default: powershell - type: string - runsOn: - description: JSON-formatted string of the types of machine to run the build job on - required: true - type: string - checkoutRef: - description: Ref to checkout - required: false - default: ${{ github.ref }} - type: string - project: - description: Name of the built project - required: true - type: string - projectName: - description: Friendly name of the built project - required: true - type: string - publishArtifacts: - description: Flag indicating whether the artifacts should be published - type: boolean - default: false - artifactsNameSuffix: - description: Suffix to add to the artifacts names - required: false - default: '' - type: string - parentTelemetryScopeJson: - description: Specifies the telemetry scope for the telemetry signal - required: false - type: string - -env: - ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} - ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} - -jobs: - Build: - needs: [ ] - runs-on: ${{ fromJson(inputs.runsOn) }} - defaults: - run: - shell: ${{ inputs.shell }} - name: '${{ inputs.projectName }}' - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ inputs.checkoutRef }} - lfs: true - - - name: Read settings - uses: microsoft/AL-Go-Actions/ReadSettings@v5.2 - with: - shell: ${{ inputs.shell }} - project: ${{ inputs.project }} - get: type,powerPlatformSolutionFolder,appRevision,appBuild - - - name: Build - uses: microsoft/AL-Go-Actions/BuildPowerPlatform@v5.2 - with: - shell: ${{ inputs.shell }} - solutionFolder: ${{ inputs.project }} - outputFolder: ${{ inputs.project }}/.buildartifacts/_PowerPlatformSolution/ - outputFileName: ${{ inputs.project }} - appRevision: ${{ env.appRevision }} - appBuild: ${{ env.appBuild }} - - - name: Calculate Artifact names - id: calculateArtifactsNames - uses: microsoft/AL-Go-Actions/CalculateArtifactNames@v5.2 - if: success() || failure() - with: - shell: ${{ inputs.shell }} - project: ${{ inputs.project }} - buildMode: 'default' - suffix: ${{ inputs.artifactsNameSuffix }} - - - name: Publish artifacts - Power Platform Solution - uses: actions/upload-artifact@v4 - if: inputs.publishArtifacts - with: - name: ${{ steps.calculateArtifactsNames.outputs.PowerPlatformSolutionArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/_PowerPlatformSolution/' - if-no-files-found: ignore