diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index bff3c2b..ea749ac 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -5,9 +5,10 @@ "environments": [ "Staging" ], - "DeployToStaging": { - "environmentName": "Sandbox", - "companyId": "f1678e37-e50b-ef11-9f8e-6045bdc8c192", - "ppEnvironmentUrl": "https://orgf287aea1.crm.dynamics.com/" - } -} \ No newline at end of file + "DeployToStaging": { + "environmentName": "Sandbox", + "companyId": "f1678e37-e50b-ef11-9f8e-6045bdc8c192", + "ppEnvironmentUrl": "https://orgf287aea1.crm.dynamics.com/" + }, + "templateSha": "8fedaa0bba2cf96f8b2b0c57b7d4ba88e9c7069b" +} diff --git a/.github/workflows/AddExistingAppOrTestApp.yaml b/.github/workflows/AddExistingAppOrTestApp.yaml index 4da2892..545dfd1 100644 --- a/.github/workflows/AddExistingAppOrTestApp.yaml +++ b/.github/workflows/AddExistingAppOrTestApp.yaml @@ -22,7 +22,9 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write defaults: @@ -39,28 +41,27 @@ jobs: runs-on: [ windows-latest ] steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0090" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -68,19 +69,20 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Add existing app - uses: microsoft/AL-Go/Actions/AddExistingApp@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/AddExistingApp@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} project: ${{ github.event.inputs.project }} url: ${{ github.event.inputs.url }} directCommit: ${{ github.event.inputs.directCommit }} - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0090" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index c090231..1e33a16 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -14,8 +14,9 @@ defaults: shell: powershell permissions: - contents: read actions: read + contents: read + id-token: write pages: read env: @@ -38,34 +39,53 @@ jobs: githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} + skippedProjects: ${{ steps.determineProjectsToBuild.outputs.SkippedProjectsJson }} projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }} buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} - powerPlatformSolutionFolder: ${{ steps.DeterminePowerPlatformSolutionFolder.outputs.powerPlatformSolutionFolder }} + baselineWorkflowRunId: ${{ steps.determineProjectsToBuild.outputs.BaselineWorkflowRunId }} + baselineWorkflowSHA: ${{ steps.determineProjectsToBuild.outputs.BaselineWorkflowSHA }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} + powerPlatformSolutionFolder: ${{ steps.DeterminePowerPlatformSolutionFolder.outputs.powerPlatformSolutionFolder }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: lfs: true - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0091" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - get: type, powerPlatformSolutionFolder + get: type,powerPlatformSolutionFolder,useGitSubmodules + + - name: Read submodules token + id: ReadSubmodulesToken + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 + with: + shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '-gitSubmodulesToken' + + - name: Checkout Submodules + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + submodules: ${{ env.useGitSubmodules }} + token: '${{ fromJson(steps.ReadSubmodulesToken.outputs.Secrets).gitSubmodulesToken }}' - name: Determine Workflow Depth id: DetermineWorkflowDepth @@ -74,7 +94,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v7.1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -87,7 +107,7 @@ jobs: - name: Determine Delivery Target Secrets id: DetermineDeliveryTargetSecrets - uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeliveryTargets@v7.1 with: shell: powershell projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}' @@ -95,7 +115,7 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -103,7 +123,7 @@ jobs: - name: Determine Delivery Targets id: DetermineDeliveryTargets - uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeliveryTargets@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -113,7 +133,7 @@ jobs: - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v7.1 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -126,19 +146,30 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell get: templateUrl + - name: Read secrets + id: ReadSecrets + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 + with: + shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: 'ghTokenWorkflow' + - name: Check for updates to AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CheckForUpdates@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell templateUrl: ${{ env.templateUrl }} + token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} downloadLatest: true Build: @@ -152,16 +183,16 @@ jobs: uses: ./.github/workflows/_BuildALGoProject.yaml secrets: inherit with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + shell: ${{ matrix.githubRunnerShell }} + runsOn: ${{ matrix.githubRunner }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} + skippedProjectsJson: ${{ needs.Initialization.outputs.skippedProjects }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} + baselineWorkflowRunId: ${{ needs.Initialization.outputs.baselineWorkflowRunId }} + baselineWorkflowSHA: ${{ needs.Initialization.outputs.baselineWorkflowSHA }} secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' - publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} - publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || startswith(github.ref_name, 'releases/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }} signArtifacts: true useArtifactCache: true @@ -182,7 +213,7 @@ jobs: DeployALDoc: needs: [ Initialization, Build ] if: (!cancelled()) && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main' - runs-on: windows-latest + runs-on: [ windows-latest ] name: Deploy Reference Documentation permissions: contents: read @@ -194,37 +225,37 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Setup Pages if: needs.Initialization.outputs.deployALDocArtifact == 1 - uses: actions/configure-pages@v5 + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - name: Build Reference Documentation - uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/BuildReferenceDocumentation@v7.1 with: shell: powershell artifacts: '.artifacts' - name: Upload pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ".aldoc/_site/" - name: Deploy to GitHub Pages if: needs.Initialization.outputs.deployALDocArtifact == 1 id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 Deploy: needs: [ Initialization, Build, BuildPP ] @@ -240,15 +271,15 @@ jobs: url: ${{ steps.Deploy.outputs.environmentUrl }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: ${{ matrix.shell }} get: type,powerPlatformSolutionFolder @@ -262,15 +293,15 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: ${{ matrix.shell }} 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' + getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext' - name: Deploy to Business Central id: Deploy - uses: microsoft/AL-Go/Actions/Deploy@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/Deploy@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -282,7 +313,7 @@ jobs: - name: Deploy to Power Platform if: env.type == 'PTE' && env.powerPlatformSolutionFolder != '' - uses: microsoft/AL-Go/Actions/DeployPowerPlatform@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DeployPowerPlatform@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -302,28 +333,28 @@ jobs: name: Deliver to ${{ matrix.deliveryTarget }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: '${{ matrix.deliveryTarget }}Context' - name: Deliver - uses: microsoft/AL-Go/Actions/Deliver@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/Deliver@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -339,12 +370,14 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0091" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/CreateApp.yaml b/.github/workflows/CreateApp.yaml index 23c9cd5..d60798d 100644 --- a/.github/workflows/CreateApp.yaml +++ b/.github/workflows/CreateApp.yaml @@ -32,7 +32,9 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write defaults: @@ -49,29 +51,28 @@ jobs: runs-on: [ windows-latest ] steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0092" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell get: type - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -79,11 +80,10 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Creating a new app - uses: microsoft/AL-Go/Actions/CreateApp@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CreateApp@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} project: ${{ github.event.inputs.project }} type: ${{ env.type }} name: ${{ github.event.inputs.name }} @@ -94,8 +94,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0092" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml b/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml index 9a26a12..fb998f2 100644 --- a/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml +++ b/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml @@ -26,7 +26,9 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write defaults: @@ -43,34 +45,33 @@ jobs: runs-on: [ windows-latest ] outputs: deviceCode: ${{ steps.authenticate.outputs.deviceCode }} - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0093" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -83,17 +84,17 @@ jobs: $settings = $env:Settings | ConvertFrom-Json if ('${{ fromJson(steps.ReadSecrets.outputs.Secrets).adminCenterApiCredentials }}') { Write-Host "AdminCenterApiCredentials provided in secret $($settings.adminCenterApiCredentialsSecretName)!" - 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." + 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." } 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/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) + $webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/AL-Go-Helper.ps1', $ALGoHelperPath) . $ALGoHelperPath DownloadAndImportBcContainerHelper $authContext = New-BcAuthContext -includeDeviceLogin -deviceLoginTimeout ([TimeSpan]::FromSeconds(0)) - 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_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)" } @@ -108,16 +109,16 @@ jobs: deviceCode: ${{ needs.Initialization.outputs.deviceCode }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -136,11 +137,10 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -value "adminCenterApiCredentials=$adminCenterApiCredentials" - name: Create Development Environment - uses: microsoft/AL-Go/Actions/CreateDevelopmentEnvironment@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CreateDevelopmentEnvironment@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} environmentName: ${{ github.event.inputs.environmentName }} project: ${{ github.event.inputs.project }} reUseExistingEnvironment: ${{ github.event.inputs.reUseExistingEnvironment }} @@ -149,8 +149,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0093" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/CreatePerformanceTestApp.yaml b/.github/workflows/CreatePerformanceTestApp.yaml index 4a50b53..fe38b8d 100644 --- a/.github/workflows/CreatePerformanceTestApp.yaml +++ b/.github/workflows/CreatePerformanceTestApp.yaml @@ -38,7 +38,9 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write defaults: @@ -55,28 +57,27 @@ jobs: runs-on: [ windows-latest ] steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0102" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -84,11 +85,10 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Creating a new test app - uses: microsoft/AL-Go/Actions/CreateApp@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CreateApp@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} project: ${{ github.event.inputs.project }} type: 'Performance Test App' name: ${{ github.event.inputs.name }} @@ -100,8 +100,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0102" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/CreateRelease.yaml b/.github/workflows/CreateRelease.yaml index 2062ea1..1cd3bf1 100644 --- a/.github/workflows/CreateRelease.yaml +++ b/.github/workflows/CreateRelease.yaml @@ -1,11 +1,14 @@ name: ' Create release' run-name: "Create release - Version ${{ inputs.tag }}" +concurrency: + group: ${{ github.workflow }} + on: workflow_dispatch: inputs: - appVersion: - description: App version to promote to release (default is latest) + buildVersion: + description: Build version to promote to release (default is latest) required: false default: 'latest' name: @@ -16,14 +19,14 @@ on: description: Tag of this release (needs to be semantic version string https://semver.org, ex. 1.0.0) required: true default: '' - prerelease: - description: Prerelease? - type: boolean - default: false - draft: - description: Draft? - type: boolean - default: false + releaseType: + description: Release, prerelease or draft? + type: choice + options: + - Release + - Prerelease + - Draft + default: Release createReleaseBranch: description: Create Release Branch? type: boolean @@ -33,9 +36,13 @@ on: type: string default: release/ updateVersionNumber: - description: New Version Number in main branch. Use Major.Minor for absolute change, use +Major.Minor for incremental change. + description: New Version Number in main branch. Use Major.Minor (optionally add .Build for versioningstrategy 3) for absolute change, or +1, +0.1 (or +0.0.1 for versioningstrategy 3) incremental change. required: false default: '' + skipUpdatingDependencies: + description: Skip updating dependency version numbers in all apps. + type: boolean + default: false directCommit: description: Direct Commit? type: boolean @@ -46,11 +53,10 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write - actions: read - -concurrency: release defaults: run: @@ -65,60 +71,60 @@ jobs: needs: [ ] runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} artifacts: ${{ steps.analyzeartifacts.outputs.artifacts }} releaseId: ${{ steps.createrelease.outputs.releaseId }} commitish: ${{ steps.analyzeartifacts.outputs.commitish }} releaseVersion: ${{ steps.createreleasenotes.outputs.releaseVersion }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0094" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell get: templateUrl,repoName,type,powerPlatformSolutionFolder - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: 'TokenForPush' + getSecrets: 'TokenForPush,ghTokenWorkflow' useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - + - name: Determine Projects id: determineProjects - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v7.1 with: shell: powershell - name: Check for updates to AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CheckForUpdates@v7.1 with: shell: powershell templateUrl: ${{ env.templateUrl }} + token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} downloadLatest: true - name: Analyze Artifacts id: analyzeartifacts env: - _appVersion: ${{ github.event.inputs.appVersion }} + _buildVersion: ${{ github.event.inputs.buildVersion }} run: | $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 $projects = '${{ steps.determineProjects.outputs.ProjectsJson }}' | ConvertFrom-Json @@ -156,14 +162,14 @@ jobs: } $refname = "$ENV:GITHUB_REF_NAME".Replace('/','_') Write-Host "Analyzing artifacts for project $project" - $appVersion = "$env:_appVersion" - if ($appVersion -eq "latest") { + $buildVersion = "$env:_buildVersion" + if ($buildVersion -eq "latest") { Write-Host "Grab latest" - $artifact = $allArtifacts | Where-Object { $_.name -like "$project-$refname-Apps-*" -or $_.name -like "$project-$refname-PowerPlatformSolution-*" } | Select-Object -First 1 + $artifact = $allArtifacts | Where-Object { $_.name -like "$project-$refname-Apps-*.*.*.*" -or $_.name -like "$project-$refname-PowerPlatformSolution-*.*.*.*" } | Select-Object -First 1 } else { - Write-Host "Search for $project-$refname-Apps-$appVersion or $project-$refname-PowerPlatformSolution-$appVersion" - $artifact = $allArtifacts | Where-Object { $_.name -eq "$project-$refname-Apps-$appVersion"-or $_.name -eq "$project-$refname-PowerPlatformSolution-$appVersion" } | Select-Object -First 1 + Write-Host "Search for $project-$refname-Apps-$buildVersion or $project-$refname-PowerPlatformSolution-$buildVersion" + $artifact = $allArtifacts | Where-Object { $_.name -eq "$project-$refname-Apps-$buildVersion"-or $_.name -eq "$project-$refname-PowerPlatformSolution-$buildVersion" } | Select-Object -First 1 } if ($artifact) { $startIndex = $artifact.name.LastIndexOf('-') + 1 @@ -203,15 +209,15 @@ jobs: - name: Prepare release notes id: createreleasenotes - uses: microsoft/AL-Go/Actions/CreateReleaseNotes@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CreateReleaseNotes@v7.1 with: shell: powershell - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + buildVersion: ${{ github.event.inputs.buildVersion }} tag_name: ${{ github.event.inputs.tag }} target_commitish: ${{ steps.analyzeartifacts.outputs.commitish }} - name: Create release - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 id: createrelease env: bodyMD: ${{ steps.createreleasenotes.outputs.releaseNotes }} @@ -225,8 +231,8 @@ jobs: tag_name: '${{ github.event.inputs.tag }}', name: '${{ github.event.inputs.name }}', body: bodyMD.replaceAll('\\n','\n').replaceAll('%0A','\n').replaceAll('%0D','\n').replaceAll('%25','%'), - draft: ${{ github.event.inputs.draft=='true' }}, - prerelease: ${{ github.event.inputs.prerelease=='true' }}, + draft: ${{ github.event.inputs.releaseType=='Draft' }}, + prerelease: ${{ github.event.inputs.releaseType=='Prerelease' }}, make_latest: 'legacy', target_commitish: '${{ steps.analyzeartifacts.outputs.commitish }}' }); @@ -243,16 +249,16 @@ jobs: fail-fast: true steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -271,7 +277,7 @@ jobs: Invoke-WebRequest -UseBasicParsing -Headers $headers -Uri '${{ matrix.url }}' -OutFile '${{ matrix.name }}.zip' - name: Upload release artifacts - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 env: releaseId: ${{ needs.createrelease.outputs.releaseId }} with: @@ -290,7 +296,7 @@ jobs: }); - name: Deliver to NuGet - uses: microsoft/AL-Go/Actions/Deliver@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/Deliver@v7.1 if: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).nuGetContext != '' }} env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -299,11 +305,11 @@ jobs: type: 'Release' projects: ${{ matrix.project }} deliveryTarget: 'NuGet' - artifacts: ${{ github.event.inputs.appVersion }} + artifacts: ${{ github.event.inputs.buildVersion }} atypes: 'Apps,TestApps' - name: Deliver to Storage - uses: microsoft/AL-Go/Actions/Deliver@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/Deliver@v7.1 if: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).storageContext != '' }} env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -312,7 +318,7 @@ jobs: type: 'Release' projects: ${{ matrix.project }} deliveryTarget: 'Storage' - artifacts: ${{ github.event.inputs.appVersion }} + artifacts: ${{ github.event.inputs.buildVersion }} atypes: 'Apps,TestApps,Dependencies' CreateReleaseBranch: @@ -321,7 +327,7 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: '${{ needs.createRelease.outputs.commitish }}' @@ -344,16 +350,16 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -361,12 +367,12 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Update Version Number - uses: microsoft/AL-Go/Actions/IncrementVersionNumber@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/IncrementVersionNumber@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ needs.CreateRelease.outputs.telemetryScopeJson }} versionNumber: ${{ github.event.inputs.updateVersionNumber }} + skipUpdatingDependencies: ${{ github.event.inputs.skipUpdatingDependencies }} directCommit: ${{ github.event.inputs.directCommit }} PostProcess: @@ -375,12 +381,14 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0094" telemetryScopeJson: ${{ needs.CreateRelease.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/CreateTestApp.yaml b/.github/workflows/CreateTestApp.yaml index d6d21eb..699bdaa 100644 --- a/.github/workflows/CreateTestApp.yaml +++ b/.github/workflows/CreateTestApp.yaml @@ -34,7 +34,9 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write defaults: @@ -51,28 +53,27 @@ jobs: runs-on: [ windows-latest ] steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0095" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -80,11 +81,10 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Creating a new test app - uses: microsoft/AL-Go/Actions/CreateApp@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CreateApp@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} project: ${{ github.event.inputs.project }} type: 'Test App' name: ${{ github.event.inputs.name }} @@ -95,8 +95,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0095" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/Current.yaml b/.github/workflows/Current.yaml index c747ada..6e33d54 100644 --- a/.github/workflows/Current.yaml +++ b/.github/workflows/Current.yaml @@ -4,8 +4,9 @@ on: workflow_dispatch: permissions: - contents: read actions: read + contents: read + id-token: write defaults: run: @@ -21,45 +22,62 @@ jobs: needs: [ ] runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} - githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} - githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }} buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} + artifactsRetentionDays: ${{ steps.DetermineWorkflowDepth.outputs.ArtifactsRetentionDays }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: lfs: true - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0101" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 + with: + shell: powershell + get: useGitSubmodules,shortLivedArtifactsRetentionDays + + - name: Read submodules token + id: ReadSubmodulesToken + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '-gitSubmodulesToken' + + - name: Checkout Submodules + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + submodules: ${{ env.useGitSubmodules }} + token: '${{ fromJson(steps.ReadSubmodulesToken.outputs.Secrets).gitSubmodulesToken }}' - name: Determine Workflow Depth id: DetermineWorkflowDepth run: | Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "WorkflowDepth=$($env:workflowDepth)" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "ArtifactsRetentionDays=$($env:shortLivedArtifactsRetentionDays)" - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v7.1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -75,15 +93,14 @@ jobs: uses: ./.github/workflows/_BuildALGoProject.yaml secrets: inherit with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + shell: ${{ matrix.githubRunnerShell }} + runsOn: ${{ matrix.githubRunner }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' - publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} + artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }} artifactsNameSuffix: 'Current' PostProcess: @@ -92,12 +109,14 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0101" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/DeployReferenceDocumentation.yaml b/.github/workflows/DeployReferenceDocumentation.yaml index bd15ec4..3dbd138 100644 --- a/.github/workflows/DeployReferenceDocumentation.yaml +++ b/.github/workflows/DeployReferenceDocumentation.yaml @@ -4,10 +4,10 @@ on: workflow_dispatch: permissions: - contents: read actions: read - pages: write + contents: read id-token: write + pages: write defaults: run: @@ -26,46 +26,55 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0097" - + - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v7.1 env: GITHUB_TOKEN: ${{ github.token }} with: shell: powershell getEnvironments: 'github-pages' type: 'Publish' - + - name: Setup Pages if: steps.DetermineDeploymentEnvironments.outputs.deployALDocArtifact == 1 - uses: actions/configure-pages@v5 - + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + - name: Build Reference Documentation - uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/BuildReferenceDocumentation@v7.1 with: shell: powershell artifacts: 'latest' - + - name: Upload pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ".aldoc/_site/" - + - name: Deploy to GitHub Pages if: steps.DetermineDeploymentEnvironments.outputs.deployALDocArtifact == 1 id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + + - name: Finalize the workflow + if: always() + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/IncrementVersionNumber.yaml b/.github/workflows/IncrementVersionNumber.yaml index d81fddb..21997f3 100644 --- a/.github/workflows/IncrementVersionNumber.yaml +++ b/.github/workflows/IncrementVersionNumber.yaml @@ -10,8 +10,13 @@ on: required: false default: '*' versionNumber: - description: Updated Version Number. Use Major.Minor for absolute change, use +Major.Minor for incremental change. - required: true + description: New Version Number in main branch. Use Major.Minor (optionally add .Build for versioningstrategy 3) for absolute change, or +1, +0.1 (or +0.0.1 for versioningstrategy 3) incremental change. + required: false + default: '' + skipUpdatingDependencies: + description: Skip updating dependency version numbers in all apps. + type: boolean + default: false directCommit: description: Direct Commit? type: boolean @@ -21,10 +26,6 @@ on: type: boolean default: false -permissions: - contents: write - pull-requests: write - defaults: run: shell: powershell @@ -37,30 +38,34 @@ jobs: IncrementVersionNumber: needs: [ ] runs-on: [ windows-latest ] + permissions: + actions: read + contents: write + id-token: write + pull-requests: write steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0096" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -68,19 +73,21 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Increment Version Number - uses: microsoft/AL-Go/Actions/IncrementVersionNumber@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/IncrementVersionNumber@v7.1 with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} projects: ${{ github.event.inputs.projects }} versionNumber: ${{ github.event.inputs.versionNumber }} + skipUpdatingDependencies: ${{ github.event.inputs.skipUpdatingDependencies }} directCommit: ${{ github.event.inputs.directCommit }} - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0096" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/NextMajor.yaml b/.github/workflows/NextMajor.yaml index 0e1ff57..0078c08 100644 --- a/.github/workflows/NextMajor.yaml +++ b/.github/workflows/NextMajor.yaml @@ -4,8 +4,9 @@ on: workflow_dispatch: permissions: - contents: read actions: read + contents: read + id-token: write defaults: run: @@ -21,45 +22,62 @@ jobs: needs: [ ] runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} - githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} - githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }} buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} + artifactsRetentionDays: ${{ steps.DetermineWorkflowDepth.outputs.ArtifactsRetentionDays }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: lfs: true - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0099" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 + with: + shell: powershell + get: useGitSubmodules,shortLivedArtifactsRetentionDays + + - name: Read submodules token + id: ReadSubmodulesToken + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '-gitSubmodulesToken' + + - name: Checkout Submodules + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + submodules: ${{ env.useGitSubmodules }} + token: '${{ fromJson(steps.ReadSubmodulesToken.outputs.Secrets).gitSubmodulesToken }}' - name: Determine Workflow Depth id: DetermineWorkflowDepth run: | Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "WorkflowDepth=$($env:workflowDepth)" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "ArtifactsRetentionDays=$($env:shortLivedArtifactsRetentionDays)" - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v7.1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -75,15 +93,14 @@ jobs: uses: ./.github/workflows/_BuildALGoProject.yaml secrets: inherit with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + shell: ${{ matrix.githubRunnerShell }} + runsOn: ${{ matrix.githubRunner }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' - publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} + artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }} artifactsNameSuffix: 'NextMajor' PostProcess: @@ -92,12 +109,14 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0099" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/NextMinor.yaml b/.github/workflows/NextMinor.yaml index 3e31548..d52ddea 100644 --- a/.github/workflows/NextMinor.yaml +++ b/.github/workflows/NextMinor.yaml @@ -4,8 +4,9 @@ on: workflow_dispatch: permissions: - contents: read actions: read + contents: read + id-token: write defaults: run: @@ -21,45 +22,62 @@ jobs: needs: [ ] runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} - githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} - githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }} buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} + artifactsRetentionDays: ${{ steps.DetermineWorkflowDepth.outputs.ArtifactsRetentionDays }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: lfs: true - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0100" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 + with: + shell: powershell + get: useGitSubmodules,shortLivedArtifactsRetentionDays + + - name: Read submodules token + id: ReadSubmodulesToken + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '-gitSubmodulesToken' + + - name: Checkout Submodules + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + submodules: ${{ env.useGitSubmodules }} + token: '${{ fromJson(steps.ReadSubmodulesToken.outputs.Secrets).gitSubmodulesToken }}' - name: Determine Workflow Depth id: DetermineWorkflowDepth run: | Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "WorkflowDepth=$($env:workflowDepth)" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "ArtifactsRetentionDays=$($env:shortLivedArtifactsRetentionDays)" - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v7.1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -75,15 +93,14 @@ jobs: uses: ./.github/workflows/_BuildALGoProject.yaml secrets: inherit with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - runsOn: ${{ needs.Initialization.outputs.githubRunner }} - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + shell: ${{ matrix.githubRunnerShell }} + runsOn: ${{ matrix.githubRunner }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' - publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} + artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }} artifactsNameSuffix: 'NextMinor' PostProcess: @@ -92,12 +109,14 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0100" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PublishToEnvironment.yaml b/.github/workflows/PublishToEnvironment.yaml index a55c3e3..840178d 100644 --- a/.github/workflows/PublishToEnvironment.yaml +++ b/.github/workflows/PublishToEnvironment.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: appVersion: - description: App version to deploy to environment(s) (current, prerelease, draft, latest or version number) + description: App version to deploy to environment(s) (current, prerelease, draft, latest, version number or PR_) required: false default: 'current' environmentName: @@ -12,8 +12,9 @@ on: required: true permissions: - contents: read actions: read + contents: read + id-token: write defaults: run: @@ -28,36 +29,35 @@ jobs: needs: [ ] runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} environmentsMatrixJson: ${{ steps.DetermineDeploymentEnvironments.outputs.EnvironmentsMatrixJson }} environmentCount: ${{ steps.DetermineDeploymentEnvironments.outputs.EnvironmentCount }} deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.DeploymentEnvironmentsJson }} deviceCode: ${{ steps.Authenticate.outputs.deviceCode }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0097" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v7.1 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -75,7 +75,7 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 if: steps.DetermineDeploymentEnvironments.outputs.UnknownEnvironment == 1 with: shell: powershell @@ -101,17 +101,17 @@ jobs: } if ($authContext) { Write-Host "AuthContext provided in secret $secretName!" - Set-Content -Path $ENV:GITHUB_STEP_SUMMARY -value "AuthContext was provided in a secret called $secretName. Using this information for authentication." + Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "AuthContext was provided in a secret called $secretName. Using this information for authentication." } else { Write-Host "No AuthContext provided for $envName, initiating Device Code flow" $ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" $webClient = New-Object System.Net.WebClient - $webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) + $webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/AL-Go-Helper.ps1', $ALGoHelperPath) . $ALGoHelperPath DownloadAndImportBcContainerHelper $authContext = New-BcAuthContext -includeDeviceLogin -deviceLoginTimeout ([TimeSpan]::FromSeconds(0)) - Set-Content -Path $ENV:GITHUB_STEP_SUMMARY -value "AL-Go needs access to the Business Central Environment $('${{ steps.envName.outputs.envName }}'.Split(' ')[0]) and could not locate a secret called ${{ steps.envName.outputs.envName }}_AuthContext`n`n$($authContext.message)" + Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "AL-Go needs access to the Business Central Environment $('${{ steps.envName.outputs.envName }}'.Split(' ')[0]) and could not locate a secret called ${{ steps.envName.outputs.envName }}_AuthContext`n`n$($authContext.message)" Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "deviceCode=$($authContext.deviceCode)" } @@ -131,7 +131,7 @@ jobs: deviceCode: ${{ needs.Initialization.outputs.deviceCode }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: EnvName id: envName @@ -141,29 +141,29 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "envName=$envName" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: ${{ matrix.shell }} get: type,powerPlatformSolutionFolder - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: ${{ matrix.shell }} 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' + getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext' - name: Get Artifacts for deployment - uses: microsoft/AL-Go/Actions/GetArtifactsForDeployment@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/GetArtifactsForDeployment@v7.1 with: - shell: powershell + shell: ${{ matrix.shell }} artifactsVersion: ${{ github.event.inputs.appVersion }} artifactsFolder: '.artifacts' - name: Deploy to Business Central id: Deploy - uses: microsoft/AL-Go/Actions/Deploy@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/Deploy@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -172,14 +172,15 @@ jobs: artifactsFolder: '.artifacts' type: 'Publish' deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} + artifactsVersion: ${{ github.event.inputs.appVersion }} - name: Deploy to Power Platform if: env.type == 'PTE' && env.powerPlatformSolutionFolder != '' - uses: microsoft/AL-Go/Actions/DeployPowerPlatform@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DeployPowerPlatform@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: - shell: powershell + shell: ${{ matrix.shell }} environmentName: ${{ matrix.environment }} artifactsFolder: '.artifacts' deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} @@ -190,12 +191,14 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0097" telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PullPowerPlatformChanges.yaml b/.github/workflows/PullPowerPlatformChanges.yaml index de721cd..41a5140 100644 --- a/.github/workflows/PullPowerPlatformChanges.yaml +++ b/.github/workflows/PullPowerPlatformChanges.yaml @@ -19,7 +19,9 @@ on: default: false permissions: + actions: read contents: write + id-token: write pull-requests: write defaults: @@ -32,14 +34,13 @@ jobs: name: Pull changes from ${{ inputs.environment }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0103" - name: EnvName env: @@ -50,14 +51,14 @@ jobs: Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "envName=$envName" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell get: powerPlatformSolutionFolder - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -66,7 +67,7 @@ jobs: - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v7.1 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -88,7 +89,7 @@ jobs: Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "solutionFolder=$solutionFolder" - name: Pull changes from Power Platform environment - uses: microsoft/AL-Go/Actions/PullPowerPlatformChanges@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/PullPowerPlatformChanges@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -101,8 +102,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0103" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PullRequestHandler.yaml b/.github/workflows/PullRequestHandler.yaml index 541ef9b..e2c9378 100644 --- a/.github/workflows/PullRequestHandler.yaml +++ b/.github/workflows/PullRequestHandler.yaml @@ -13,8 +13,9 @@ defaults: shell: powershell permissions: - contents: read actions: read + contents: read + id-token: write pull-requests: read env: @@ -27,54 +28,55 @@ jobs: if: (github.event.pull_request.base.repo.full_name != github.event.pull_request.head.repo.full_name) && (github.event_name != 'pull_request') runs-on: windows-latest steps: - - uses: microsoft/AL-Go/Actions/VerifyPRChanges@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + - uses: microsoft/AL-Go-Actions/VerifyPRChanges@v7.1 Initialization: needs: [ PregateCheck ] if: (!failure() && !cancelled()) runs-on: [ windows-latest ] outputs: - telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} - githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} - githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }} projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }} buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} baselineWorkflowRunId: ${{ steps.determineProjectsToBuild.outputs.BaselineWorkflowRunId }} + baselineWorkflowSHA: ${{ steps.determineProjectsToBuild.outputs.BaselineWorkflowSHA }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} + artifactsRetentionDays: ${{ steps.DetermineWorkflowDepth.outputs.ArtifactsRetentionDays }} + telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: lfs: true - ref: refs/pull/${{ github.event.number }}/merge + ref: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0104" - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell + get: shortLivedArtifactsRetentionDays - name: Determine Workflow Depth id: DetermineWorkflowDepth run: | Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "WorkflowDepth=$($env:workflowDepth)" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "ArtifactsRetentionDays=$($env:shortLivedArtifactsRetentionDays)" - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineProjectsToBuild@v7.1 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -90,18 +92,19 @@ jobs: uses: ./.github/workflows/_BuildALGoProject.yaml secrets: inherit with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - runsOn: ${{ needs.Initialization.outputs.githubRunner }} - checkoutRef: refs/pull/${{ github.event.number }}/merge - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + shell: ${{ matrix.githubRunnerShell }} + runsOn: ${{ matrix.githubRunner }} + checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} baselineWorkflowRunId: ${{ needs.Initialization.outputs.baselineWorkflowRunId }} + baselineWorkflowSHA: ${{ needs.Initialization.outputs.baselineWorkflowSHA }} secrets: 'licenseFileUrl,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' - publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} + artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }} artifactsNameSuffix: 'PR${{ github.event.number }}' + useArtifactCache: true StatusCheck: needs: [ Initialization, Build ] @@ -111,8 +114,19 @@ jobs: steps: - name: Pull Request Status Check id: PullRequestStatusCheck - uses: microsoft/AL-Go/Actions/PullRequestStatusCheck@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/PullRequestStatusCheck@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + shell: powershell + + - name: Finalize the workflow + id: PostProcess + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + if: success() || failure() env: GITHUB_TOKEN: ${{ github.token }} with: shell: powershell + telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/PushPowerPlatformChanges.yaml b/.github/workflows/PushPowerPlatformChanges.yaml index 37d8dd1..240a3bb 100644 --- a/.github/workflows/PushPowerPlatformChanges.yaml +++ b/.github/workflows/PushPowerPlatformChanges.yaml @@ -11,7 +11,9 @@ on: required: false permissions: + actions: read contents: read + id-token: write defaults: run: @@ -23,14 +25,13 @@ jobs: name: Push changes to ${{ inputs.environment }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0103" - name: EnvName env: @@ -42,14 +43,14 @@ jobs: Add-Content -encoding utf8 -Path $env:GITHUB_ENV -Value "envName=$envName" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell get: powerPlatformSolutionFolder - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -57,7 +58,7 @@ jobs: - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DetermineDeploymentEnvironments@v7.1 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -79,7 +80,7 @@ jobs: 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@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DeployPowerPlatform@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -90,8 +91,10 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0103" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/Troubleshooting.yaml b/.github/workflows/Troubleshooting.yaml index 69a8a79..8e13731 100644 --- a/.github/workflows/Troubleshooting.yaml +++ b/.github/workflows/Troubleshooting.yaml @@ -9,8 +9,8 @@ on: default: false permissions: - contents: read actions: read + contents: read defaults: run: @@ -25,12 +25,12 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: lfs: true - name: Troubleshooting - uses: microsoft/AL-Go/Actions/Troubleshooting@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/Troubleshooting@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} diff --git a/.github/workflows/UpdateGitHubGoSystemFiles.yaml b/.github/workflows/UpdateGitHubGoSystemFiles.yaml index bdffb1f..552da5b 100644 --- a/.github/workflows/UpdateGitHubGoSystemFiles.yaml +++ b/.github/workflows/UpdateGitHubGoSystemFiles.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: templateUrl: - description: Template Repository URL (current is {TEMPLATEURL}) + description: Template Repository URL (current is https://github.com/Microsoft/al-go-pte@preview) required: false default: '' downloadLatest: @@ -15,9 +15,15 @@ on: description: Direct Commit? type: boolean default: false + includeBranches: + description: Specify a comma-separated list of branches to update. Wildcards are supported. The AL-Go settings will be read for every branch. Leave empty to update the current branch only. + required: false + default: '' permissions: + actions: read contents: read + id-token: write defaults: run: @@ -28,82 +34,122 @@ env: ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} jobs: + Initialize: + runs-on: windows-latest + name: Initialize + outputs: + UpdateBranches: ${{ steps.GetBranches.outputs.Result }} + TemplateUrl: ${{ steps.DetermineTemplateUrl.outputs.TemplateUrl }} + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Read settings + id: ReadSettings + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 + with: + shell: powershell + get: templateUrl + + - name: Get Workflow Multi-Run Branches + id: GetBranches + uses: microsoft/AL-Go-Actions/GetWorkflowMultiRunBranches@v7.1 + with: + shell: powershell + includeBranches: ${{ github.event.inputs.includeBranches }} + + - name: Determine Template URL + id: DetermineTemplateUrl + env: + TemplateUrlAsInput: '${{ github.event.inputs.templateUrl }}' + run: | + $templateUrl = $env:templateUrl # Available from ReadSettings step + if ($ENV:TemplateUrlAsInput) { + # Use the input value if it is provided + $templateUrl = $ENV:TemplateUrlAsInput + } + Write-Host "Using template URL: $templateUrl" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "TemplateUrl=$templateUrl" + UpdateALGoSystemFiles: - needs: [ ] + name: "[${{ matrix.branch }}] Update AL-Go System Files" + needs: [ Initialize ] runs-on: [ windows-latest ] + strategy: + matrix: + branch: ${{ fromJson(needs.Initialize.outputs.UpdateBranches).branches }} + fail-fast: false + steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/DumpWorkflowInfo@v7.1 with: shell: powershell - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ matrix.branch }} - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowInitialize@v7.1 with: shell: powershell - eventId: "DO0098" - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: powershell - get: templateUrl + get: commitOptions - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: 'ghTokenWorkflow' - - name: Override templateUrl - env: - templateUrl: ${{ github.event.inputs.templateUrl }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $templateUrl = $ENV:templateUrl - if ($templateUrl) { - Write-Host "Using Template Url: $templateUrl" - Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "templateUrl=$templateUrl" - } - - - name: Calculate Input + - name: Calculate Commit Options env: directCommit: '${{ github.event.inputs.directCommit }}' - downloadLatest: ${{ github.event.inputs.downloadLatest }} - eventName: ${{ github.event_name }} + downloadLatest: '${{ github.event.inputs.downloadLatest }}' run: | $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $directCommit = $ENV:directCommit - $downloadLatest = $ENV:downloadLatest - Write-Host $ENV:eventName - if ($ENV:eventName -eq 'schedule') { - Write-Host "Running Update AL-Go System Files on a schedule. Setting DirectCommit and DownloadLatest to true" - $directCommit = 'true' - $downloadLatest = 'true' + if('${{ github.event_name }}' -eq 'workflow_dispatch') { + Write-Host "Using inputs from workflow_dispatch event" + $directCommit = $env:directCommit + $downloadLatest = $env:downloadLatest + } + else { + Write-Host "Using inputs from commitOptions setting" + $commitOptions = $env:commitOptions | ConvertFrom-Json # Available from ReadSettings step + $directCommit=$(-not $commitOptions.createPullRequest) + $downloadLatest=$true } Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "directCommit=$directCommit" Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "downloadLatest=$downloadLatest" - name: Update AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CheckForUpdates@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} downloadLatest: ${{ env.downloadLatest }} update: 'Y' - templateUrl: ${{ env.templateUrl }} + templateUrl: ${{ needs.Initialize.outputs.TemplateUrl }} directCommit: ${{ env.directCommit }} + updateBranch: ${{ matrix.branch }} - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v7.1 + env: + GITHUB_TOKEN: ${{ github.token }} with: shell: powershell - eventId: "DO0098" telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} + currentJobContext: ${{ toJson(job) }} diff --git a/.github/workflows/_BuildALGoProject.yaml b/.github/workflows/_BuildALGoProject.yaml index 2fa8e68..538baa5 100644 --- a/.github/workflows/_BuildALGoProject.yaml +++ b/.github/workflows/_BuildALGoProject.yaml @@ -17,7 +17,7 @@ on: checkoutRef: description: Ref to checkout required: false - default: ${{ github.ref }} + default: ${{ github.sha }} type: string project: description: Name of the built project @@ -27,6 +27,11 @@ on: description: Friendly name of the built project required: true type: string + skippedProjectsJson: + description: An array of AL-Go projects to skip in compressed JSON format + required: false + default: '[]' + type: string projectDependenciesJson: description: Dependencies of the built project in compressed Json format required: false @@ -41,19 +46,20 @@ on: required: false default: '0' type: string + baselineWorkflowSHA: + description: SHA of the baseline workflow run + required: false + default: '' + type: string secrets: description: A comma-separated string with the names of the secrets, required for the workflow. required: false default: '' type: string - publishThisBuildArtifacts: - description: Flag indicating whether this build artifacts should be published - type: boolean - default: false - publishArtifacts: - description: Flag indicating whether the artifacts should be published - type: boolean - default: false + artifactsRetentionDays: + description: Number of days to keep the artifacts + type: number + default: 0 artifactsNameSuffix: description: Suffix to add to the artifacts names required: false @@ -67,14 +73,11 @@ on: description: Flag determining whether to use the Artifacts Cache type: boolean default: false - parentTelemetryScopeJson: - description: Specifies the telemetry scope for the telemetry signal - required: false - type: string permissions: - contents: read actions: read + contents: read + id-token: write env: ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} @@ -90,81 +93,102 @@ jobs: name: ${{ inputs.projectName }} (${{ inputs.buildMode }}) steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.checkoutRef }} lfs: true - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} - get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact,generateDependencyArtifact + buildMode: ${{ inputs.buildMode }} + get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,doNotRunBcptTests,doNotRunpageScriptingTests,artifact,generateDependencyArtifact,trustedSigning,useGitSubmodules + + - name: Determine whether to build project + id: DetermineBuildProject + uses: microsoft/AL-Go-Actions/DetermineBuildProject@v7.1 + with: + shell: ${{ inputs.shell }} + skippedProjectsJson: ${{ inputs.skippedProjectsJson }} + project: ${{ inputs.project }} + baselineWorkflowRunId: ${{ inputs.baselineWorkflowRunId }} - name: Read secrets id: ReadSecrets - if: github.event_name != 'pull_request' - uses: microsoft/AL-Go/Actions/ReadSecrets@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' && github.event_name != 'pull_request' + uses: microsoft/AL-Go-Actions/ReadSecrets@v7.1 with: shell: ${{ inputs.shell }} gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: '${{ inputs.secrets }},appDependencyProbingPathsSecrets' + getSecrets: '${{ inputs.secrets }},appDependencySecrets,AZURE_CREDENTIALS,-gitSubmodulesToken' + + - name: Checkout Submodules + if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.checkoutRef }} + lfs: true + submodules: ${{ env.useGitSubmodules }} + token: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).gitSubmodulesToken }}' - name: Determine ArtifactUrl - uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 id: determineArtifactUrl + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' + uses: microsoft/AL-Go-Actions/DetermineArtifactUrl@v7.1 with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} project: ${{ inputs.project }} - name: Cache Business Central Artifacts - if: env.useCompilerFolder == 'True' && inputs.useArtifactCache && env.artifactCacheKey - uses: actions/cache@v4 + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' && env.useCompilerFolder == 'True' && inputs.useArtifactCache && env.artifactCacheKey + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: - path: .artifactcache + path: ${{ runner.temp }}/.artifactcache key: ${{ env.artifactCacheKey }} - name: Download Project Dependencies id: DownloadProjectDependencies - uses: microsoft/AL-Go/Actions/DownloadProjectDependencies@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' + uses: microsoft/AL-Go-Actions/DownloadProjectDependencies@v7.1 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} buildMode: ${{ inputs.buildMode }} - projectsDependenciesJson: ${{ inputs.projectDependenciesJson }} + projectDependenciesJson: ${{ inputs.projectDependenciesJson }} baselineWorkflowRunId: ${{ inputs.baselineWorkflowRunId }} - name: Build - uses: microsoft/AL-Go/Actions/RunPipeline@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/RunPipeline@v7.1 + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' BuildMode: ${{ inputs.buildMode }} with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} artifact: ${{ env.artifact }} project: ${{ inputs.project }} buildMode: ${{ inputs.buildMode }} installAppsJson: ${{ steps.DownloadProjectDependencies.outputs.DownloadedApps }} installTestAppsJson: ${{ steps.DownloadProjectDependencies.outputs.DownloadedTestApps }} + baselineWorkflowRunId: ${{ inputs.baselineWorkflowRunId }} + baselineWorkflowSHA: ${{ inputs.baselineWorkflowSHA }} - name: Sign - if: inputs.signArtifacts && env.doNotSignApps == 'False' && env.keyVaultCodesignCertificateName != '' id: sign - uses: microsoft/AL-Go/Actions/Sign@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' && inputs.signArtifacts && env.doNotSignApps == 'False' && (env.keyVaultCodesignCertificateName != '' || (fromJson(env.trustedSigning).Endpoint != '' && fromJson(env.trustedSigning).Account != '' && fromJson(env.trustedSigning).CertificateProfile != '')) + uses: microsoft/AL-Go-Actions/Sign@v7.1 with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - azureCredentialsJson: ${{ secrets.AZURE_CREDENTIALS }} + shell: ${{ inputs.shell }} + azureCredentialsJson: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).AZURE_CREDENTIALS }}' pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app' - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} - name: Calculate Artifact names id: calculateArtifactsNames - uses: microsoft/AL-Go/Actions/CalculateArtifactNames@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CalculateArtifactNames@v7.1 if: success() || failure() with: shell: ${{ inputs.shell }} @@ -172,59 +196,35 @@ jobs: buildMode: ${{ inputs.buildMode }} suffix: ${{ inputs.artifactsNameSuffix }} - - name: Upload thisbuild artifacts - apps - if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildAppsArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/Apps/' - if-no-files-found: ignore - retention-days: 1 - - - name: Upload thisbuild artifacts - dependencies - if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildDependenciesArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/Dependencies/' - if-no-files-found: ignore - retention-days: 1 - - - name: Upload thisbuild artifacts - test apps - if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildTestAppsArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/TestApps/' - if-no-files-found: ignore - retention-days: 1 - - name: Publish artifacts - apps - uses: actions/upload-artifact@v4 - if: inputs.publishArtifacts + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: inputs.artifactsRetentionDays >= 0 && (hashFiles(format('{0}/.buildartifacts/Apps/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.AppsArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/Apps/' if-no-files-found: ignore + retention-days: ${{ inputs.artifactsRetentionDays }} - name: Publish artifacts - dependencies - uses: actions/upload-artifact@v4 - if: inputs.publishArtifacts && env.generateDependencyArtifact == 'True' + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: inputs.artifactsRetentionDays >= 0 && env.generateDependencyArtifact == 'True' && (hashFiles(format('{0}/.buildartifacts/Dependencies/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/Dependencies/' if-no-files-found: ignore + retention-days: ${{ inputs.artifactsRetentionDays }} - name: Publish artifacts - test apps - uses: actions/upload-artifact@v4 - if: inputs.publishArtifacts + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: inputs.artifactsRetentionDays >= 0 && (hashFiles(format('{0}/.buildartifacts/TestApps/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.TestAppsArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/TestApps/' if-no-files-found: ignore + retention-days: ${{ inputs.artifactsRetentionDays }} - name: Publish artifacts - build output - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: (success() || failure()) && (hashFiles(format('{0}/BuildOutput.txt',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.BuildOutputArtifactsName }} @@ -232,7 +232,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - container event log - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: (failure()) && (hashFiles(format('{0}/ContainerEventLog.evtx',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.ContainerEventLogArtifactsName }} @@ -240,34 +240,67 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - test results - uses: actions/upload-artifact@v4 - if: (success() || failure()) && (hashFiles(format('{0}/TestResults.xml',inputs.project)) != '') + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/TestResults.xml',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.TestResultsArtifactsName }} - path: '${{ inputs.project }}/TestResults.xml' + path: '${{ inputs.project }}/.buildartifacts/TestResults.xml' if-no-files-found: ignore - name: Publish artifacts - bcpt test results - uses: actions/upload-artifact@v4 - if: (success() || failure()) && (hashFiles(format('{0}/bcptTestResults.json',inputs.project)) != '') + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/bcptTestResults.json',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.BcptTestResultsArtifactsName }} - path: '${{ inputs.project }}/bcptTestResults.json' + path: '${{ inputs.project }}/.buildartifacts/bcptTestResults.json' + if-no-files-found: ignore + + - name: Publish artifacts - page scripting test results + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/PageScriptingTestResults.xml',inputs.project)) != '') + with: + name: ${{ steps.calculateArtifactsNames.outputs.PageScriptingTestResultsArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/PageScriptingTestResults.xml' + if-no-files-found: ignore + + - name: Publish artifacts - page scripting test result details + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/PageScriptingTestResultDetails/*',inputs.project)) != '') + with: + name: ${{ steps.calculateArtifactsNames.outputs.PageScriptingTestResultDetailsArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/PageScriptingTestResultDetails/' if-no-files-found: ignore - name: Analyze Test Results id: analyzeTestResults - if: (success() || failure()) && env.doNotRunTests == 'False' - uses: microsoft/AL-Go/Actions/AnalyzeTests@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + if: (success() || failure()) && env.doNotRunTests == 'False' && ((hashFiles(format('{0}/.buildartifacts/TestResults.xml',inputs.project)) != '') || (hashFiles(format('{0}/.buildartifacts/bcptTestResults.json',inputs.project)) != '')) + uses: microsoft/AL-Go-Actions/AnalyzeTests@v7.1 + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + testType: "normal" + + - name: Analyze BCPT Test Results + id: analyzeTestResultsBCPT + if: (success() || failure()) && env.doNotRunBcptTests == 'False' + uses: microsoft/AL-Go-Actions/AnalyzeTests@v7.1 + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + testType: "bcpt" + + - name: Analyze Page Scripting Test Results + id: analyzeTestResultsPageScripting + if: (success() || failure()) && env.doNotRunpageScriptingTests == 'False' + uses: microsoft/AL-Go-Actions/AnalyzeTests@v7.1 with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} project: ${{ inputs.project }} + testType: "pageScripting" - name: Cleanup - if: always() - uses: microsoft/AL-Go/Actions/PipelineCleanup@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + if: always() && steps.DetermineBuildProject.outputs.BuildIt == 'True' + uses: microsoft/AL-Go-Actions/PipelineCleanup@v7.1 with: shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} project: ${{ inputs.project }} diff --git a/.github/workflows/_BuildPowerPlatformSolution.yaml b/.github/workflows/_BuildPowerPlatformSolution.yaml index 4981244..f215af7 100644 --- a/.github/workflows/_BuildPowerPlatformSolution.yaml +++ b/.github/workflows/_BuildPowerPlatformSolution.yaml @@ -17,7 +17,7 @@ on: checkoutRef: description: Ref to checkout required: false - default: ${{ github.ref }} + default: ${{ github.sha }} type: string project: description: Name of the built project @@ -55,20 +55,20 @@ jobs: name: '${{ inputs.projectName }}' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.checkoutRef }} lfs: true - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/ReadSettings@v7.1 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} get: type,powerPlatformSolutionFolder,appRevision,appBuild - name: Build - uses: microsoft/AL-Go/Actions/BuildPowerPlatform@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/BuildPowerPlatform@v7.1 with: shell: ${{ inputs.shell }} solutionFolder: ${{ inputs.project }} @@ -79,7 +79,7 @@ jobs: - name: Calculate Artifact names id: calculateArtifactsNames - uses: microsoft/AL-Go/Actions/CalculateArtifactNames@6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17 + uses: microsoft/AL-Go-Actions/CalculateArtifactNames@v7.1 if: success() || failure() with: shell: ${{ inputs.shell }} @@ -88,7 +88,7 @@ jobs: suffix: ${{ inputs.artifactsNameSuffix }} - name: Publish artifacts - Power Platform Solution - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: inputs.publishArtifacts with: name: ${{ steps.calculateArtifactsNames.outputs.PowerPlatformSolutionArtifactsName }} diff --git a/ALApp/.AL-Go/cloudDevEnv.ps1 b/ALApp/.AL-Go/cloudDevEnv.ps1 index 0fd9843..4f068a9 100644 --- a/ALApp/.AL-Go/cloudDevEnv.ps1 +++ b/ALApp/.AL-Go/cloudDevEnv.ps1 @@ -12,6 +12,21 @@ Param( $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +function DownloadHelperFile { + param( + [string] $url, + [string] $folder + ) + + $prevProgressPreference = $ProgressPreference; $ProgressPreference = 'SilentlyContinue' + $name = [System.IO.Path]::GetFileName($url) + Write-Host "Downloading $name from $url" + $path = Join-Path $folder $name + Invoke-WebRequest -UseBasicParsing -uri $url -OutFile $path + $ProgressPreference = $prevProgressPreference + return $path +} + try { Clear-Host Write-Host @@ -25,17 +40,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/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/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/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/AL-Go-Helper.ps1' -Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) +$tmpFolder = Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::NewGuid().ToString())" +New-Item -Path $tmpFolder -ItemType Directory -Force | Out-Null +$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/Github-Helper.psm1' -folder $tmpFolder +$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/AL-Go-Helper.ps1' -folder $tmpFolder +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/Packages.json' -folder $tmpFolder | Out-Null Import-Module $GitHubHelperPath . $ALGoHelperPath -local diff --git a/ALApp/.AL-Go/localDevEnv.ps1 b/ALApp/.AL-Go/localDevEnv.ps1 index d771670..0c73194 100644 --- a/ALApp/.AL-Go/localDevEnv.ps1 +++ b/ALApp/.AL-Go/localDevEnv.ps1 @@ -16,6 +16,21 @@ Param( $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +function DownloadHelperFile { + param( + [string] $url, + [string] $folder + ) + + $prevProgressPreference = $ProgressPreference; $ProgressPreference = 'SilentlyContinue' + $name = [System.IO.Path]::GetFileName($url) + Write-Host "Downloading $name from $url" + $path = Join-Path $folder $name + Invoke-WebRequest -UseBasicParsing -uri $url -OutFile $path + $ProgressPreference = $prevProgressPreference + return $path +} + try { Clear-Host Write-Host @@ -29,17 +44,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/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/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/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/AL-Go-Helper.ps1' -Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) +$tmpFolder = Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::NewGuid().ToString())" +New-Item -Path $tmpFolder -ItemType Directory -Force | Out-Null +$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/Github-Helper.psm1' -folder $tmpFolder +$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/AL-Go-Helper.ps1' -folder $tmpFolder +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go-Actions/v7.1/Packages.json' -folder $tmpFolder | Out-Null Import-Module $GitHubHelperPath . $ALGoHelperPath -local