diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index c422933..46e535c 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -1,6 +1,6 @@ { "type": "PTE", - "templateUrl": "https://github.com/freddydk/AL-Go@main", + "templateUrl": "https://github.com/freddydk/AL-Go@bcptreport", "runs-on": "bc-build", "BcContainerHelperVersion": "preview", "GenerateDependencyArtifact": true, diff --git a/.github/workflows/AddExistingAppOrTestApp.yaml b/.github/workflows/AddExistingAppOrTestApp.yaml index f61bc00..25f335a 100644 --- a/.github/workflows/AddExistingAppOrTestApp.yaml +++ b/.github/workflows/AddExistingAppOrTestApp.yaml @@ -13,12 +13,13 @@ on: description: Direct Download Url of .app or .zip file required: true directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -34,26 +35,32 @@ env: jobs: AddExistingAppOrTestApp: + needs: [ ] runs-on: [ bc-build ] steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0090" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -61,7 +68,7 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Add existing app - uses: freddydk/AL-Go/Actions/AddExistingApp@main + uses: freddydk/AL-Go/Actions/AddExistingApp@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} @@ -72,7 +79,7 @@ jobs: - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0090" diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index 1159473..5c6a2a2 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -24,12 +24,15 @@ env: jobs: Initialization: + needs: [ ] runs-on: [ bc-build ] outputs: telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} environmentsMatrixJson: ${{ steps.DetermineDeploymentEnvironments.outputs.EnvironmentsMatrixJson }} environmentCount: ${{ steps.DetermineDeploymentEnvironments.outputs.EnvironmentCount }} deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.DeploymentEnvironmentsJson }} + generateALDocArtifact: ${{ steps.DetermineDeploymentEnvironments.outputs.GenerateALDocArtifact }} + deployALDocArtifact: ${{ steps.DetermineDeploymentEnvironments.outputs.DeployALDocArtifact }} deliveryTargetsJson: ${{ steps.DetermineDeliveryTargets.outputs.DeliveryTargetsJson }} githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} @@ -38,6 +41,11 @@ jobs: buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 with: @@ -45,14 +53,14 @@ jobs: - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0091" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell get: type @@ -64,22 +72,22 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@main + uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} - name: Determine Delivery Target Secrets id: DetermineDeliveryTargetSecrets - uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@main + uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@bcptreport with: shell: powershell projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}' - checkContextSecrets: 'N' + checkContextSecrets: 'false' - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -87,17 +95,17 @@ jobs: - name: Determine Delivery Targets id: DetermineDeliveryTargets - uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@main + uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@bcptreport env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: shell: powershell projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}' - checkContextSecrets: 'Y' + checkContextSecrets: 'true' - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@main + uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@bcptreport env: GITHUB_TOKEN: ${{ github.token }} with: @@ -106,24 +114,24 @@ jobs: type: 'CD' CheckForUpdates: - runs-on: [ bc-build ] needs: [ Initialization ] + runs-on: [ bc-build ] steps: - name: Checkout uses: actions/checkout@v3 - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell get: templateUrl - name: Check for updates to AL-Go system files - uses: freddydk/AL-Go/Actions/CheckForUpdates@main + uses: freddydk/AL-Go/Actions/CheckForUpdates@bcptreport with: shell: powershell - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} templateUrl: ${{ env.templateUrl }} + downloadLatest: true Build: needs: [ Initialization ] @@ -149,6 +157,53 @@ jobs: signArtifacts: true useArtifactCache: true + DeployALDoc: + needs: [ Initialization, Build ] + if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.generateALDocArtifact == 1 && github.ref_name == 'main' + runs-on: windows-latest + name: Deploy Reference Documentation + permissions: + contents: write + actions: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: '.artifacts' + + - name: Read settings + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport + with: + shell: powershell + + - name: Setup Pages + if: needs.Initialization.outputs.deployALDocArtifact == 1 + uses: actions/configure-pages@v3 + + - name: Build Reference Documentation + uses: freddydk/AL-Go/Actions/BuildReferenceDocumentation@bcptreport + with: + shell: powershell + artifacts: '.artifacts' + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ".aldoc/_site/" + + - name: Deploy to GitHub Pages + if: needs.Initialization.outputs.deployALDocArtifact == 1 + id: deployment + uses: actions/deploy-pages@v2 + Deploy: needs: [ Initialization, Build ] if: always() && needs.Build.result == 'Success' && needs.Initialization.outputs.environmentCount > 0 @@ -157,6 +212,7 @@ jobs: name: Deploy to ${{ matrix.environment }} environment: name: ${{ matrix.environment }} + url: ${{ steps.Deploy.outputs.environmentUrl }} steps: - name: Checkout uses: actions/checkout@v3 @@ -167,7 +223,7 @@ jobs: path: '.artifacts' - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell @@ -180,14 +236,15 @@ jobs: - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext,${{ steps.envName.outputs.envName }}-EnvironmentName,${{ steps.envName.outputs.envName }}_EnvironmentName,EnvironmentName,projects' - name: Deploy - uses: freddydk/AL-Go/Actions/Deploy@main + id: Deploy + uses: freddydk/AL-Go/Actions/Deploy@bcptreport env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -216,20 +273,20 @@ jobs: path: '.artifacts' - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: '${{ matrix.deliveryTarget }}Context' - name: Deliver - uses: freddydk/AL-Go/Actions/Deliver@main + uses: freddydk/AL-Go/Actions/Deliver@bcptreport env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -240,16 +297,16 @@ jobs: artifacts: '.artifacts' PostProcess: + needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc ] if: (!cancelled()) runs-on: [ bc-build ] - needs: [ Initialization, Build, Deploy, Deliver ] steps: - name: Checkout uses: actions/checkout@v3 - name: Finalize the workflow id: PostProcess - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0091" diff --git a/.github/workflows/CreateApp.yaml b/.github/workflows/CreateApp.yaml index 9f11226..a26eb9a 100644 --- a/.github/workflows/CreateApp.yaml +++ b/.github/workflows/CreateApp.yaml @@ -19,16 +19,17 @@ on: description: ID range (from..to) required: true sampleCode: - description: Include Sample code (Y/N) - required: false - default: 'Y' + description: Include Sample code? + type: boolean + default: true directCommit: - description: Direct COMMIT (Y/N) - required: false - default: "N" + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -44,27 +45,33 @@ env: jobs: CreateApp: + needs: [ ] runs-on: [ bc-build ] steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0092" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell get: type - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -72,7 +79,7 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Creating a new app - uses: freddydk/AL-Go/Actions/CreateApp@main + uses: freddydk/AL-Go/Actions/CreateApp@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} @@ -87,7 +94,7 @@ jobs: - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0092" diff --git a/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml b/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml index 8c56a3c..3af467c 100644 --- a/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml +++ b/.github/workflows/CreateOnlineDevelopmentEnvironment.yaml @@ -13,16 +13,17 @@ on: description: Name of the online environment required: true reUseExistingEnvironment: - description: Reuse environment if it exists - required: false - default: 'N' + description: Reuse environment if it exists? + type: boolean + default: false directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -38,6 +39,7 @@ env: jobs: Initialization: + needs: [ ] runs-on: [ bc-build ] outputs: deviceCode: ${{ steps.authenticate.outputs.deviceCode }} @@ -45,25 +47,30 @@ jobs: githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }} githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0093" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -76,27 +83,27 @@ 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/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) + $webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/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)" } CreateDevelopmentEnvironment: + needs: [ Initialization ] runs-on: ${{ fromJson(needs.Initialization.outputs.githubRunner) }} defaults: run: shell: ${{ needs.Initialization.outputs.githubRunnerShell }} name: Create Development Environment - needs: [ Initialization ] env: deviceCode: ${{ needs.Initialization.outputs.deviceCode }} steps: @@ -104,13 +111,13 @@ jobs: uses: actions/checkout@v3 - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -129,7 +136,7 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -value "adminCenterApiCredentials=$adminCenterApiCredentials" - name: Create Development Environment - uses: freddydk/AL-Go/Actions/CreateDevelopmentEnvironment@main + uses: freddydk/AL-Go/Actions/CreateDevelopmentEnvironment@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} @@ -142,7 +149,7 @@ jobs: - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0093" diff --git a/.github/workflows/CreatePerformanceTestApp.yaml b/.github/workflows/CreatePerformanceTestApp.yaml index 04bcdc4..c91cd9a 100644 --- a/.github/workflows/CreatePerformanceTestApp.yaml +++ b/.github/workflows/CreatePerformanceTestApp.yaml @@ -21,20 +21,21 @@ on: required: true default: '50000..99999' sampleCode: - description: Include Sample code (Y/N) - required: false - default: 'Y' + description: Include Sample code? + type: boolean + default: true sampleSuite: - description: Include Sample BCPT Suite (Y/N) - required: false - default: 'Y' + description: Include Sample BCPT Suite? + type: boolean + default: true directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -50,26 +51,32 @@ env: jobs: CreatePerformanceTestApp: + needs: [ ] runs-on: [ bc-build ] steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0102" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -77,7 +84,7 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Creating a new test app - uses: freddydk/AL-Go/Actions/CreateApp@main + uses: freddydk/AL-Go/Actions/CreateApp@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} @@ -93,7 +100,7 @@ jobs: - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0102" diff --git a/.github/workflows/CreateRelease.yaml b/.github/workflows/CreateRelease.yaml index d4aab4d..02b3f15 100644 --- a/.github/workflows/CreateRelease.yaml +++ b/.github/workflows/CreateRelease.yaml @@ -16,28 +16,29 @@ on: required: true default: '' prerelease: - description: Prerelease (Y/N) - required: false - default: 'N' + description: Prerelease? + type: boolean + default: false draft: - description: Draft (Y/N) - required: false - default: 'N' + description: Draft? + type: boolean + default: false createReleaseBranch: - description: Create Release Branch (Y/N) - required: false - default: 'N' + description: Create Release Branch? + type: boolean + default: false updateVersionNumber: description: New Version Number in main branch. Use Major.Minor for absolute change, use +Major.Minor for incremental change. required: false default: '' directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -56,6 +57,7 @@ env: jobs: CreateRelease: + needs: [ ] runs-on: [ bc-build ] outputs: telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} @@ -64,35 +66,40 @@ jobs: commitish: ${{ steps.analyzeartifacts.outputs.commitish }} releaseBranch: ${{ steps.createreleasenotes.outputs.releaseBranch }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0094" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell get: templateUrl,repoName - name: Determine Projects id: determineProjects - uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@main + uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport with: shell: powershell - name: Check for updates to AL-Go system files - uses: freddydk/AL-Go/Actions/CheckForUpdates@main + uses: freddydk/AL-Go/Actions/CheckForUpdates@bcptreport with: shell: powershell - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} templateUrl: ${{ env.templateUrl }} + downloadLatest: true - name: Analyze Artifacts id: analyzeartifacts @@ -173,7 +180,7 @@ jobs: - name: Prepare release notes id: createreleasenotes - uses: freddydk/AL-Go/Actions/CreateReleaseNotes@main + uses: freddydk/AL-Go/Actions/CreateReleaseNotes@bcptreport with: shell: powershell parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} @@ -195,8 +202,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=='Y' }}, - prerelease: ${{ github.event.inputs.prerelease=='Y' }}, + draft: ${{ github.event.inputs.draft=='true' }}, + prerelease: ${{ github.event.inputs.prerelease=='true' }}, make_latest: 'legacy', target_commitish: '${{ steps.analyzeartifacts.outputs.commitish }}' }); @@ -206,8 +213,8 @@ jobs: core.setOutput('releaseId', releaseId); UploadArtifacts: - runs-on: [ bc-build ] needs: [ CreateRelease ] + runs-on: [ bc-build ] strategy: matrix: ${{ fromJson(needs.CreateRelease.outputs.artifacts) }} fail-fast: true @@ -216,13 +223,13 @@ jobs: uses: actions/checkout@v3 - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -259,7 +266,7 @@ jobs: }); - name: Deliver to NuGet - uses: freddydk/AL-Go/Actions/Deliver@main + uses: freddydk/AL-Go/Actions/Deliver@bcptreport if: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).nuGetContext != '' }} env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -272,7 +279,7 @@ jobs: atypes: 'Apps,TestApps' - name: Deliver to Storage - uses: freddydk/AL-Go/Actions/Deliver@main + uses: freddydk/AL-Go/Actions/Deliver@bcptreport if: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).storageContext != '' }} env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -285,9 +292,9 @@ jobs: atypes: 'Apps,TestApps,Dependencies' CreateReleaseBranch: - if: ${{ github.event.inputs.createReleaseBranch=='Y' }} - runs-on: [ bc-build ] needs: [ CreateRelease, UploadArtifacts ] + if: ${{ github.event.inputs.createReleaseBranch=='true' }} + runs-on: [ bc-build ] steps: - name: Checkout uses: actions/checkout@v3 @@ -304,18 +311,18 @@ jobs: git push origin ${{ needs.CreateRelease.outputs.releaseBranch }} UpdateVersionNumber: + needs: [ CreateRelease, UploadArtifacts ] if: ${{ github.event.inputs.updateVersionNumber!='' }} runs-on: [ bc-build ] - needs: [ CreateRelease, UploadArtifacts ] steps: - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -323,7 +330,7 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Update Version Number - uses: freddydk/AL-Go/Actions/IncrementVersionNumber@main + uses: freddydk/AL-Go/Actions/IncrementVersionNumber@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} @@ -332,16 +339,16 @@ jobs: directCommit: ${{ github.event.inputs.directCommit }} PostProcess: + needs: [ CreateRelease, UploadArtifacts, CreateReleaseBranch, UpdateVersionNumber ] if: always() runs-on: [ bc-build ] - needs: [ CreateRelease, UploadArtifacts, CreateReleaseBranch, UpdateVersionNumber ] steps: - name: Checkout uses: actions/checkout@v3 - name: Finalize the workflow id: PostProcess - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0094" diff --git a/.github/workflows/CreateTestApp.yaml b/.github/workflows/CreateTestApp.yaml index 95074af..80292a4 100644 --- a/.github/workflows/CreateTestApp.yaml +++ b/.github/workflows/CreateTestApp.yaml @@ -21,16 +21,17 @@ on: required: true default: '50000..99999' sampleCode: - description: Include Sample code (Y/N) - required: false - default: 'Y' + description: Include Sample code? + type: boolean + default: true directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -46,26 +47,32 @@ env: jobs: CreateTestApp: + needs: [ ] runs-on: [ bc-build ] steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0095" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -73,7 +80,7 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Creating a new test app - uses: freddydk/AL-Go/Actions/CreateApp@main + uses: freddydk/AL-Go/Actions/CreateApp@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} @@ -88,7 +95,7 @@ jobs: - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0095" diff --git a/.github/workflows/Current.yaml b/.github/workflows/Current.yaml index bffa1ba..6411fc9 100644 --- a/.github/workflows/Current.yaml +++ b/.github/workflows/Current.yaml @@ -17,6 +17,7 @@ env: jobs: Initialization: + needs: [ ] runs-on: [ bc-build ] outputs: telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} @@ -27,6 +28,11 @@ jobs: buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 with: @@ -34,14 +40,14 @@ jobs: - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0101" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell @@ -52,7 +58,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@main + uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -80,16 +86,16 @@ jobs: artifactsNameSuffix: 'Current' PostProcess: + needs: [ Initialization, Build ] if: always() runs-on: [ bc-build ] - needs: [ Initialization, Build ] steps: - name: Checkout uses: actions/checkout@v3 - name: Finalize the workflow id: PostProcess - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0101" diff --git a/.github/workflows/DeployReferenceDocumentation.yaml b/.github/workflows/DeployReferenceDocumentation.yaml new file mode 100644 index 0000000..3153ad3 --- /dev/null +++ b/.github/workflows/DeployReferenceDocumentation.yaml @@ -0,0 +1,71 @@ +name: ' Deploy Reference Documentation' + +on: + workflow_dispatch: + +permissions: + contents: write + actions: read + pages: write + id-token: write + +defaults: + run: + shell: powershell + +env: + ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} + ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} + +jobs: + DeployALDoc: + runs-on: [ bc-build ] + name: Deploy Reference Documentation + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize the workflow + id: init + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport + with: + shell: powershell + eventId: "DO0097" + + - name: Read settings + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport + with: + shell: powershell + + - name: Determine Deployment Environments + id: DetermineDeploymentEnvironments + uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@bcptreport + 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@v3 + + - name: Build Reference Documentation + uses: freddydk/AL-Go/Actions/BuildReferenceDocumentation@bcptreport + with: + shell: powershell + artifacts: 'latest' + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ".aldoc/_site/" + + - name: Deploy to GitHub Pages + if: steps.DetermineDeploymentEnvironments.outputs.deployALDocArtifact == 1 + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/IncrementVersionNumber.yaml b/.github/workflows/IncrementVersionNumber.yaml index 0cc4f3b..2fec062 100644 --- a/.github/workflows/IncrementVersionNumber.yaml +++ b/.github/workflows/IncrementVersionNumber.yaml @@ -5,20 +5,21 @@ run-name: "Increment Version Number in [${{ github.ref_name }}]" on: workflow_dispatch: inputs: - project: - description: Project name if the repository is setup for multiple projects (* for all projects) + projects: + description: Comma-separated list of project name patterns if the repository is setup for multiple projects (default is * for all projects) required: false default: '*' versionNumber: description: Updated Version Number. Use Major.Minor for absolute change, use +Major.Minor for incremental change. required: true directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false useGhTokenWorkflow: - description: Use GhTokenWorkflow for Pull Request/COMMIT + description: Use GhTokenWorkflow for PR/Commit? type: boolean + default: false permissions: contents: write @@ -34,26 +35,32 @@ env: jobs: IncrementVersionNumber: + needs: [ ] runs-on: [ bc-build ] steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0096" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -61,18 +68,18 @@ jobs: useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}' - name: Increment Version Number - uses: freddydk/AL-Go/Actions/IncrementVersionNumber@main + uses: freddydk/AL-Go/Actions/IncrementVersionNumber@bcptreport with: shell: powershell token: ${{ steps.ReadSecrets.outputs.TokenForPush }} parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} - project: ${{ github.event.inputs.project }} + projects: ${{ github.event.inputs.projects }} versionNumber: ${{ github.event.inputs.versionNumber }} directCommit: ${{ github.event.inputs.directCommit }} - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0096" diff --git a/.github/workflows/NextMajor.yaml b/.github/workflows/NextMajor.yaml index 9ccd796..cc237da 100644 --- a/.github/workflows/NextMajor.yaml +++ b/.github/workflows/NextMajor.yaml @@ -17,6 +17,7 @@ env: jobs: Initialization: + needs: [ ] runs-on: [ bc-build ] outputs: telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} @@ -27,6 +28,11 @@ jobs: buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 with: @@ -34,14 +40,14 @@ jobs: - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0099" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell @@ -52,7 +58,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@main + uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -80,16 +86,16 @@ jobs: artifactsNameSuffix: 'NextMajor' PostProcess: + needs: [ Initialization, Build ] if: always() runs-on: [ bc-build ] - needs: [ Initialization, Build ] steps: - name: Checkout uses: actions/checkout@v3 - name: Finalize the workflow id: PostProcess - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0099" diff --git a/.github/workflows/NextMinor.yaml b/.github/workflows/NextMinor.yaml index 8d179c1..2be5f63 100644 --- a/.github/workflows/NextMinor.yaml +++ b/.github/workflows/NextMinor.yaml @@ -17,6 +17,7 @@ env: jobs: Initialization: + needs: [ ] runs-on: [ bc-build ] outputs: telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} @@ -27,6 +28,11 @@ jobs: buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 with: @@ -34,14 +40,14 @@ jobs: - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0100" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell @@ -52,7 +58,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@main + uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -80,16 +86,16 @@ jobs: artifactsNameSuffix: 'NextMinor' PostProcess: + needs: [ Initialization, Build ] if: always() runs-on: [ bc-build ] - needs: [ Initialization, Build ] steps: - name: Checkout uses: actions/checkout@v3 - name: Finalize the workflow id: PostProcess - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0100" diff --git a/.github/workflows/PublishToEnvironment.yaml b/.github/workflows/PublishToEnvironment.yaml index 21f9a8c..2d1715d 100644 --- a/.github/workflows/PublishToEnvironment.yaml +++ b/.github/workflows/PublishToEnvironment.yaml @@ -25,6 +25,7 @@ env: jobs: Initialization: + needs: [ ] runs-on: [ bc-build ] outputs: telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} @@ -33,25 +34,30 @@ jobs: deploymentEnvironmentsJson: ${{ steps.DetermineDeploymentEnvironments.outputs.DeploymentEnvironmentsJson }} deviceCode: ${{ steps.Authenticate.outputs.deviceCode }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0097" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@main + uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@bcptreport env: GITHUB_TOKEN: ${{ github.token }} with: @@ -69,7 +75,7 @@ jobs: - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport if: steps.DetermineDeploymentEnvironments.outputs.UnknownEnvironment == 1 with: shell: powershell @@ -95,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/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) + $webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/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)" } @@ -117,6 +123,7 @@ jobs: name: Deploy to ${{ matrix.environment }} environment: name: ${{ matrix.environment }} + url: ${{ steps.Deploy.outputs.environmentUrl }} env: deviceCode: ${{ needs.Initialization.outputs.deviceCode }} steps: @@ -131,20 +138,21 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "envName=$envName" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext,${{ steps.envName.outputs.envName }}-EnvironmentName,${{ steps.envName.outputs.envName }}_EnvironmentName,EnvironmentName,projects' - name: Deploy - uses: freddydk/AL-Go/Actions/Deploy@main + id: Deploy + uses: freddydk/AL-Go/Actions/Deploy@bcptreport env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -155,16 +163,16 @@ jobs: deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} PostProcess: + needs: [ Initialization, Deploy ] if: always() runs-on: [ bc-build ] - needs: [ Initialization, Deploy ] steps: - name: Checkout uses: actions/checkout@v3 - name: Finalize the workflow id: PostProcess - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0097" diff --git a/.github/workflows/PullRequestHandler.yaml b/.github/workflows/PullRequestHandler.yaml index e240718..ce0ae8c 100644 --- a/.github/workflows/PullRequestHandler.yaml +++ b/.github/workflows/PullRequestHandler.yaml @@ -2,8 +2,6 @@ name: 'Pull Request Build' on: pull_request_target: - paths-ignore: - - '**.md' branches: [ 'main' ] concurrency: @@ -29,7 +27,7 @@ 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: freddydk/AL-Go/Actions/VerifyPRChanges@main + - uses: freddydk/AL-Go/Actions/VerifyPRChanges@bcptreport Initialization: needs: [ PregateCheck ] @@ -44,6 +42,11 @@ jobs: buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 with: @@ -52,14 +55,14 @@ jobs: - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0104" - name: Read settings id: ReadSettings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell @@ -70,7 +73,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@main + uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@bcptreport with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -96,16 +99,17 @@ jobs: projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} secrets: 'licenseFileUrl,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} + artifactsNameSuffix: 'PR${{ github.event.number }}' StatusCheck: - runs-on: [ windows-latest ] needs: [ Initialization, Build ] if: (!cancelled()) + runs-on: [ windows-latest ] name: Pull Request Status Check steps: - name: Pull Request Status Check id: PullRequestStatusCheck - uses: freddydk/AL-Go/Actions/PullRequestStatusCheck@main + uses: freddydk/AL-Go/Actions/PullRequestStatusCheck@bcptreport env: GITHUB_TOKEN: ${{ github.token }} with: diff --git a/.github/workflows/UpdateGitHubGoSystemFiles.yaml b/.github/workflows/UpdateGitHubGoSystemFiles.yaml index 72f14a9..9c8c87e 100644 --- a/.github/workflows/UpdateGitHubGoSystemFiles.yaml +++ b/.github/workflows/UpdateGitHubGoSystemFiles.yaml @@ -4,13 +4,17 @@ on: workflow_dispatch: inputs: templateUrl: - description: Template Repository URL (current is https://github.com/freddydk/AL-Go@main) + description: Template Repository URL (current is https://github.com/freddydk/AL-Go@bcptreport) required: false default: '' + downloadLatest: + description: Download latest from template repository + type: boolean + default: true directCommit: - description: Direct COMMIT (Y/N) - required: false - default: 'N' + description: Direct Commit? + type: boolean + default: false permissions: contents: read @@ -25,27 +29,33 @@ env: jobs: UpdateALGoSystemFiles: + needs: [ ] runs-on: [ windows-latest ] steps: + - name: Dump Workflow Information + uses: freddydk/AL-Go/Actions/DumpWorkflowInfo@bcptreport + with: + shell: powershell + - name: Checkout uses: actions/checkout@v3 - name: Initialize the workflow id: init - uses: freddydk/AL-Go/Actions/WorkflowInitialize@main + uses: freddydk/AL-Go/Actions/WorkflowInitialize@bcptreport with: shell: powershell eventId: "DO0098" - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport with: shell: powershell get: templateUrl - name: Read secrets id: ReadSecrets - uses: freddydk/AL-Go/Actions/ReadSecrets@main + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -62,33 +72,37 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "templateUrl=$templateUrl" } - - name: Calculate DirectCommit + - name: Calculate Input env: - directCommit: ${{ github.event.inputs.directCommit }} + directCommit: '${{ github.event.inputs.directCommit }}' + downloadLatest: ${{ github.event.inputs.downloadLatest }} eventName: ${{ github.event_name }} 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 = Y" - $directCommit = 'Y' + Write-Host "Running Update AL-Go System Files on a schedule. Setting DirectCommit and DownloadLatest to true" + $directCommit = 'true' + $downloadLatest = 'true' } - Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "DirectCommit=$directCommit" + 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: freddydk/AL-Go/Actions/CheckForUpdates@main + uses: freddydk/AL-Go/Actions/CheckForUpdates@bcptreport with: shell: powershell - parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} - Update: Y + downloadLatest: ${{ env.downloadLatest }} + update: 'Y' templateUrl: ${{ env.templateUrl }} directCommit: ${{ env.directCommit }} - name: Finalize the workflow if: always() - uses: freddydk/AL-Go/Actions/WorkflowPostProcess@main + uses: freddydk/AL-Go/Actions/WorkflowPostProcess@bcptreport with: shell: powershell eventId: "DO0098" diff --git a/.github/workflows/_BuildALGoProject.yaml b/.github/workflows/_BuildALGoProject.yaml index bc4f352..a1ece0d 100644 --- a/.github/workflows/_BuildALGoProject.yaml +++ b/.github/workflows/_BuildALGoProject.yaml @@ -43,14 +43,12 @@ on: type: string publishThisBuildArtifacts: description: Flag indicating whether this build artifacts should be published - required: false - default: false type: boolean + default: false publishArtifacts: description: Flag indicating whether the artifacts should be published - required: false - default: false type: boolean + default: false artifactsNameSuffix: description: Suffix to add to the artifacts names required: false @@ -58,14 +56,12 @@ on: type: string signArtifacts: description: Flag indicating whether the apps should be signed - required: false - default: false type: boolean + default: false useArtifactCache: description: Flag determining whether to use the Artifacts Cache - required: false - default: false type: boolean + default: false parentTelemetryScopeJson: description: Specifies the telemetry scope for the telemetry signal required: false @@ -77,180 +73,191 @@ env: jobs: BuildALGoProject: + needs: [ ] runs-on: ${{ fromJson(inputs.runsOn) }} + defaults: + run: + shell: ${{ inputs.shell }} name: ${{ inputs.projectName }} (${{ inputs.buildMode }}) steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ inputs.checkoutRef }} - lfs: true + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ inputs.checkoutRef }} + lfs: true + + - name: Read settings + uses: freddydk/AL-Go/Actions/ReadSettings@bcptreport + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact,generateDependencyArtifact - - name: Read settings - uses: freddydk/AL-Go/Actions/ReadSettings@main - with: - shell: ${{ inputs.shell }} - project: ${{ inputs.project }} - get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,artifact + - name: Read secrets + id: ReadSecrets + if: github.event_name != 'pull_request' + uses: freddydk/AL-Go/Actions/ReadSecrets@bcptreport + with: + shell: ${{ inputs.shell }} + gitHubSecrets: ${{ toJson(secrets) }} + getSecrets: '${{ inputs.secrets }},appDependencyProbingPathsSecrets' - - name: Read secrets - id: ReadSecrets - if: github.event_name != 'pull_request' - uses: freddydk/AL-Go/Actions/ReadSecrets@main - with: - shell: ${{ inputs.shell }} - gitHubSecrets: ${{ toJson(secrets) }} - getSecrets: '${{ inputs.secrets }},appDependencyProbingPathsSecrets' + - name: Determine ArtifactUrl + uses: freddydk/AL-Go/Actions/DetermineArtifactUrl@bcptreport + id: determineArtifactUrl + with: + shell: ${{ inputs.shell }} + parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} + project: ${{ inputs.project }} - - name: Determine ArtifactUrl - uses: freddydk/AL-Go/Actions/DetermineArtifactUrl@main - id: determineArtifactUrl - 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@v3 + with: + path: .artifactcache + key: ${{ env.artifactCacheKey }} - - name: Cache Business Central Artifacts - if: env.useCompilerFolder == 'True' && inputs.useArtifactCache && env.artifactCacheKey - uses: actions/cache@v3 - with: - path: .artifactcache - key: ${{ env.artifactCacheKey }} + - name: Download Project Dependencies + id: DownloadProjectDependencies + uses: freddydk/AL-Go/Actions/DownloadProjectDependencies@bcptreport + env: + Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + buildMode: ${{ inputs.buildMode }} + projectsDependenciesJson: ${{ inputs.projectDependenciesJson }} - - name: Download Project Dependencies - id: DownloadProjectDependencies - uses: freddydk/AL-Go/Actions/DownloadProjectDependencies@main - env: - Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' - with: - shell: ${{ inputs.shell }} - project: ${{ inputs.project }} - buildMode: ${{ inputs.buildMode }} - projectsDependenciesJson: ${{ inputs.projectDependenciesJson }} + - name: Build + uses: freddydk/AL-Go/Actions/RunPipeline@bcptreport + 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 }} - - name: Run pipeline - id: RunPipeline - uses: freddydk/AL-Go/Actions/RunPipeline@main - 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 }} + - name: Sign + if: inputs.signArtifacts && env.doNotSignApps == 'False' && env.keyVaultCodesignCertificateName != '' + id: sign + uses: freddydk/AL-Go/Actions/Sign@bcptreport + with: + shell: ${{ needs.Initialization.outputs.githubRunnerShell }} + azureCredentialsJson: ${{ secrets.AZURE_CREDENTIALS }} + pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app' + parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} - - name: Sign - if: inputs.signArtifacts && env.doNotSignApps == 'False' && env.keyVaultCodesignCertificateName != '' - id: sign - uses: freddydk/AL-Go/Actions/Sign@main - with: - shell: ${{ needs.Initialization.outputs.githubRunnerShell }} - azureCredentialsJson: ${{ secrets.AZURE_CREDENTIALS }} - pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app' - parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }} + - name: Calculate Artifact names + id: calculateArtifactsNames + uses: freddydk/AL-Go/Actions/CalculateArtifactNames@bcptreport + if: success() || failure() + with: + shell: ${{ inputs.shell }} + project: ${{ inputs.project }} + buildMode: ${{ inputs.buildMode }} + suffix: ${{ inputs.artifactsNameSuffix }} - - name: Calculate Artifact names - id: calculateArtifactsNames - uses: freddydk/AL-Go/Actions/CalculateArtifactNames@main - if: success() || failure() - with: - shell: ${{ inputs.shell }} - project: ${{ inputs.project }} - buildMode: ${{ inputs.buildMode }} - branchName: ${{ github.ref_name }} - suffix: ${{ inputs.artifactsNameSuffix }} + - name: Upload thisbuild artifacts - apps + if: inputs.publishThisBuildArtifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildAppsArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/Apps/' + if-no-files-found: ignore + retention-days: 1 - - name: Upload thisbuild artifacts - apps - if: inputs.publishThisBuildArtifacts - uses: actions/upload-artifact@v3 - 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@v3 + 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@v3 - with: - name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildTestAppsArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/TestApps/' - if-no-files-found: ignore - retention-days: 1 + - name: Upload thisbuild artifacts - test apps + if: inputs.publishThisBuildArtifacts + uses: actions/upload-artifact@v3 + 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@v3 - if: inputs.publishArtifacts - with: - name: ${{ steps.calculateArtifactsNames.outputs.AppsArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/Apps/' - if-no-files-found: ignore + - name: Publish artifacts - apps + uses: actions/upload-artifact@v3 + if: inputs.publishArtifacts + with: + name: ${{ steps.calculateArtifactsNames.outputs.AppsArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/Apps/' + if-no-files-found: ignore - - name: Publish artifacts - dependencies - uses: actions/upload-artifact@v3 - if: inputs.publishArtifacts - with: - name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/Dependencies/' - if-no-files-found: ignore + - name: Publish artifacts - dependencies + uses: actions/upload-artifact@v3 + if: inputs.publishArtifacts && env.generateDependencyArtifact == 'True' + with: + name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/Dependencies/' + if-no-files-found: ignore - - name: Publish artifacts - test apps - uses: actions/upload-artifact@v3 - if: inputs.publishArtifacts - with: - name: ${{ steps.calculateArtifactsNames.outputs.TestAppsArtifactsName }} - path: '${{ inputs.project }}/.buildartifacts/TestApps/' - if-no-files-found: ignore + - name: Publish artifacts - test apps + uses: actions/upload-artifact@v3 + if: inputs.publishArtifacts + with: + name: ${{ steps.calculateArtifactsNames.outputs.TestAppsArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/TestApps/' + if-no-files-found: ignore - - name: Publish artifacts - build output - uses: actions/upload-artifact@v3 - if: (success() || failure()) && (hashFiles(format('{0}/BuildOutput.txt',inputs.project)) != '') - with: - name: ${{ steps.calculateArtifactsNames.outputs.BuildOutputArtifactsName }} - path: '${{ inputs.project }}/BuildOutput.txt' - if-no-files-found: ignore + - name: Publish artifacts - build output + uses: actions/upload-artifact@v3 + if: (success() || failure()) && (hashFiles(format('{0}/BuildOutput.txt',inputs.project)) != '') + with: + name: ${{ steps.calculateArtifactsNames.outputs.BuildOutputArtifactsName }} + path: '${{ inputs.project }}/BuildOutput.txt' + if-no-files-found: ignore - - name: Publish artifacts - container event log - uses: actions/upload-artifact@v3 - if: (failure()) && (hashFiles(format('{0}/ContainerEventLog.evtx',inputs.project)) != '') - with: - name: ${{ steps.calculateArtifactsNames.outputs.ContainerEventLogArtifactsName }} - path: '${{ inputs.project }}/ContainerEventLog.evtx' - if-no-files-found: ignore + - name: Publish artifacts - container event log + uses: actions/upload-artifact@v3 + if: (failure()) && (hashFiles(format('{0}/ContainerEventLog.evtx',inputs.project)) != '') + with: + name: ${{ steps.calculateArtifactsNames.outputs.ContainerEventLogArtifactsName }} + path: '${{ inputs.project }}/ContainerEventLog.evtx' + if-no-files-found: ignore - - name: Publish artifacts - test results - uses: actions/upload-artifact@v3 - if: (success() || failure()) && (hashFiles(format('{0}/TestResults.xml',inputs.project)) != '') - with: - name: ${{ steps.calculateArtifactsNames.outputs.TestResultsArtifactsName }} - path: '${{ inputs.project }}/TestResults.xml' - if-no-files-found: ignore + - name: Publish artifacts - test results + uses: actions/upload-artifact@v3 + if: (success() || failure()) && (hashFiles(format('{0}/TestResults.xml',inputs.project)) != '') + with: + name: ${{ steps.calculateArtifactsNames.outputs.TestResultsArtifactsName }} + path: '${{ inputs.project }}/TestResults.xml' + if-no-files-found: ignore - - name: Publish artifacts - bcpt test results - uses: actions/upload-artifact@v3 - if: (success() || failure()) && (hashFiles(format('{0}/bcptTestResults.json',inputs.project)) != '') - with: - name: ${{ steps.calculateArtifactsNames.outputs.BcptTestResultsArtifactsName }} - path: '${{ inputs.project }}/bcptTestResults.json' - if-no-files-found: ignore + - name: Publish artifacts - bcpt test results + uses: actions/upload-artifact@v3 + if: (success() || failure()) && (hashFiles(format('{0}/bcptTestResults.json',inputs.project)) != '') + with: + name: ${{ steps.calculateArtifactsNames.outputs.BcptTestResultsArtifactsName }} + path: '${{ inputs.project }}/bcptTestResults.json' + if-no-files-found: ignore - - name: Analyze Test Results - id: analyzeTestResults - if: success() || failure() - uses: freddydk/AL-Go/Actions/AnalyzeTests@main - with: - shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} - project: ${{ inputs.project }} + - name: Analyze Test Results + id: analyzeTestResults + if: (success() || failure()) && env.doNotRunTests == 'False' + uses: freddydk/AL-Go/Actions/AnalyzeTests@bcptreport + with: + shell: ${{ inputs.shell }} + parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} + project: ${{ inputs.project }} - - name: Cleanup - if: always() - uses: freddydk/AL-Go/Actions/PipelineCleanup@main - with: - shell: ${{ inputs.shell }} - parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} - project: ${{ inputs.project }} + - name: Cleanup + if: always() + uses: freddydk/AL-Go/Actions/PipelineCleanup@bcptreport + with: + shell: ${{ inputs.shell }} + parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} + project: ${{ inputs.project }} diff --git a/App2.dk/.AL-Go/cloudDevEnv.ps1 b/App2.dk/.AL-Go/cloudDevEnv.ps1 index 66bfeda..51204f7 100644 --- a/App2.dk/.AL-Go/cloudDevEnv.ps1 +++ b/App2.dk/.AL-Go/cloudDevEnv.ps1 @@ -12,22 +12,6 @@ Param( $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 try { -$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 -Write-Host "Downloading GitHub Helper module" -$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/Github-Helper.psm1', $GitHubHelperPath) -Write-Host "Downloading AL-Go Helper script" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) - -Import-Module $GitHubHelperPath -. $ALGoHelperPath -local - -$baseFolder = GetBaseFolder -folder $PSScriptRoot -$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot - Clear-Host Write-Host Write-Host -ForegroundColor Yellow @' @@ -40,7 +24,26 @@ Write-Host -ForegroundColor Yellow @' '@ +$webClient = New-Object System.Net.WebClient +$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore) +$webClient.Encoding = [System.Text.Encoding]::UTF8 +$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1' +Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl" +$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" +$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath) +$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1' +Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" +$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" +$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) + +Import-Module $GitHubHelperPath +. $ALGoHelperPath -local + +$baseFolder = GetBaseFolder -folder $PSScriptRoot +$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot + Write-Host @' + This script will create a cloud based development environment (Business Central SaaS Sandbox) for your project. All apps and test apps will be compiled and published to the environment in the development scope. The script will also modify launch.json to have a "Cloud Sandbox ()" configuration point to your environment. diff --git a/App2.dk/.AL-Go/localDevEnv.ps1 b/App2.dk/.AL-Go/localDevEnv.ps1 index ef11a7c..088e615 100644 --- a/App2.dk/.AL-Go/localDevEnv.ps1 +++ b/App2.dk/.AL-Go/localDevEnv.ps1 @@ -8,28 +8,13 @@ Param( [string] $auth = "", [pscredential] $credential = $null, [string] $licenseFileUrl = "", - [switch] $fromVSCode + [switch] $fromVSCode, + [switch] $accept_insiderEula ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 try { -$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 -Write-Host "Downloading GitHub Helper module" -$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/Github-Helper.psm1', $GitHubHelperPath) -Write-Host "Downloading AL-Go Helper script" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) - -Import-Module $GitHubHelperPath -. $ALGoHelperPath -local - -$baseFolder = GetBaseFolder -folder $PSScriptRoot -$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot - Clear-Host Write-Host Write-Host -ForegroundColor Yellow @' @@ -42,7 +27,26 @@ Write-Host -ForegroundColor Yellow @' '@ +$webClient = New-Object System.Net.WebClient +$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore) +$webClient.Encoding = [System.Text.Encoding]::UTF8 +$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1' +Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl" +$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" +$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath) +$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1' +Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" +$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" +$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) + +Import-Module $GitHubHelperPath +. $ALGoHelperPath -local + +$baseFolder = GetBaseFolder -folder $PSScriptRoot +$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot + Write-Host @' + This script will create a docker based local development environment for your project. NOTE: You need to have Docker installed, configured and be able to create Business Central containers for this to work. @@ -53,7 +57,7 @@ The script will also modify launch.json to have a Local Sandbox configuration po '@ -$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME +$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME -workflowName 'localDevEnv' Write-Host "Checking System Requirements" $dockerProcess = (Get-Process "dockerd" -ErrorAction Ignore) @@ -129,7 +133,8 @@ CreateDevEnv ` -project $project ` -auth $auth ` -credential $credential ` - -licenseFileUrl $licenseFileUrl + -licenseFileUrl $licenseFileUrl ` + -accept_insiderEula:$accept_insiderEula } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/App2.it/.AL-Go/cloudDevEnv.ps1 b/App2.it/.AL-Go/cloudDevEnv.ps1 index 66bfeda..51204f7 100644 --- a/App2.it/.AL-Go/cloudDevEnv.ps1 +++ b/App2.it/.AL-Go/cloudDevEnv.ps1 @@ -12,22 +12,6 @@ Param( $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 try { -$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 -Write-Host "Downloading GitHub Helper module" -$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/Github-Helper.psm1', $GitHubHelperPath) -Write-Host "Downloading AL-Go Helper script" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) - -Import-Module $GitHubHelperPath -. $ALGoHelperPath -local - -$baseFolder = GetBaseFolder -folder $PSScriptRoot -$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot - Clear-Host Write-Host Write-Host -ForegroundColor Yellow @' @@ -40,7 +24,26 @@ Write-Host -ForegroundColor Yellow @' '@ +$webClient = New-Object System.Net.WebClient +$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore) +$webClient.Encoding = [System.Text.Encoding]::UTF8 +$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1' +Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl" +$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" +$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath) +$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1' +Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" +$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" +$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) + +Import-Module $GitHubHelperPath +. $ALGoHelperPath -local + +$baseFolder = GetBaseFolder -folder $PSScriptRoot +$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot + Write-Host @' + This script will create a cloud based development environment (Business Central SaaS Sandbox) for your project. All apps and test apps will be compiled and published to the environment in the development scope. The script will also modify launch.json to have a "Cloud Sandbox ()" configuration point to your environment. diff --git a/App2.it/.AL-Go/localDevEnv.ps1 b/App2.it/.AL-Go/localDevEnv.ps1 index ef11a7c..088e615 100644 --- a/App2.it/.AL-Go/localDevEnv.ps1 +++ b/App2.it/.AL-Go/localDevEnv.ps1 @@ -8,28 +8,13 @@ Param( [string] $auth = "", [pscredential] $credential = $null, [string] $licenseFileUrl = "", - [switch] $fromVSCode + [switch] $fromVSCode, + [switch] $accept_insiderEula ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 try { -$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 -Write-Host "Downloading GitHub Helper module" -$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/Github-Helper.psm1', $GitHubHelperPath) -Write-Host "Downloading AL-Go Helper script" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) - -Import-Module $GitHubHelperPath -. $ALGoHelperPath -local - -$baseFolder = GetBaseFolder -folder $PSScriptRoot -$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot - Clear-Host Write-Host Write-Host -ForegroundColor Yellow @' @@ -42,7 +27,26 @@ Write-Host -ForegroundColor Yellow @' '@ +$webClient = New-Object System.Net.WebClient +$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore) +$webClient.Encoding = [System.Text.Encoding]::UTF8 +$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1' +Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl" +$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" +$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath) +$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1' +Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" +$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" +$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) + +Import-Module $GitHubHelperPath +. $ALGoHelperPath -local + +$baseFolder = GetBaseFolder -folder $PSScriptRoot +$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot + Write-Host @' + This script will create a docker based local development environment for your project. NOTE: You need to have Docker installed, configured and be able to create Business Central containers for this to work. @@ -53,7 +57,7 @@ The script will also modify launch.json to have a Local Sandbox configuration po '@ -$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME +$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME -workflowName 'localDevEnv' Write-Host "Checking System Requirements" $dockerProcess = (Get-Process "dockerd" -ErrorAction Ignore) @@ -129,7 +133,8 @@ CreateDevEnv ` -project $project ` -auth $auth ` -credential $credential ` - -licenseFileUrl $licenseFileUrl + -licenseFileUrl $licenseFileUrl ` + -accept_insiderEula:$accept_insiderEula } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/App2/.AL-Go/cloudDevEnv.ps1 b/App2/.AL-Go/cloudDevEnv.ps1 index 66bfeda..51204f7 100644 --- a/App2/.AL-Go/cloudDevEnv.ps1 +++ b/App2/.AL-Go/cloudDevEnv.ps1 @@ -12,22 +12,6 @@ Param( $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 try { -$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 -Write-Host "Downloading GitHub Helper module" -$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/Github-Helper.psm1', $GitHubHelperPath) -Write-Host "Downloading AL-Go Helper script" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) - -Import-Module $GitHubHelperPath -. $ALGoHelperPath -local - -$baseFolder = GetBaseFolder -folder $PSScriptRoot -$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot - Clear-Host Write-Host Write-Host -ForegroundColor Yellow @' @@ -40,7 +24,26 @@ Write-Host -ForegroundColor Yellow @' '@ +$webClient = New-Object System.Net.WebClient +$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore) +$webClient.Encoding = [System.Text.Encoding]::UTF8 +$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1' +Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl" +$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" +$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath) +$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1' +Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" +$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" +$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) + +Import-Module $GitHubHelperPath +. $ALGoHelperPath -local + +$baseFolder = GetBaseFolder -folder $PSScriptRoot +$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot + Write-Host @' + This script will create a cloud based development environment (Business Central SaaS Sandbox) for your project. All apps and test apps will be compiled and published to the environment in the development scope. The script will also modify launch.json to have a "Cloud Sandbox ()" configuration point to your environment. diff --git a/App2/.AL-Go/localDevEnv.ps1 b/App2/.AL-Go/localDevEnv.ps1 index ef11a7c..088e615 100644 --- a/App2/.AL-Go/localDevEnv.ps1 +++ b/App2/.AL-Go/localDevEnv.ps1 @@ -8,28 +8,13 @@ Param( [string] $auth = "", [pscredential] $credential = $null, [string] $licenseFileUrl = "", - [switch] $fromVSCode + [switch] $fromVSCode, + [switch] $accept_insiderEula ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 try { -$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 -Write-Host "Downloading GitHub Helper module" -$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/Github-Helper.psm1', $GitHubHelperPath) -Write-Host "Downloading AL-Go Helper script" -$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" -$webClient.DownloadFile('https://raw.githubusercontent.com/freddydk/AL-Go/main/Actions/AL-Go-Helper.ps1', $ALGoHelperPath) - -Import-Module $GitHubHelperPath -. $ALGoHelperPath -local - -$baseFolder = GetBaseFolder -folder $PSScriptRoot -$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot - Clear-Host Write-Host Write-Host -ForegroundColor Yellow @' @@ -42,7 +27,26 @@ Write-Host -ForegroundColor Yellow @' '@ +$webClient = New-Object System.Net.WebClient +$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore) +$webClient.Encoding = [System.Text.Encoding]::UTF8 +$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/Github-Helper.psm1' +Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl" +$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1" +$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath) +$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/bcptreport/Actions/AL-Go-Helper.ps1' +Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl" +$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1" +$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath) + +Import-Module $GitHubHelperPath +. $ALGoHelperPath -local + +$baseFolder = GetBaseFolder -folder $PSScriptRoot +$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot + Write-Host @' + This script will create a docker based local development environment for your project. NOTE: You need to have Docker installed, configured and be able to create Business Central containers for this to work. @@ -53,7 +57,7 @@ The script will also modify launch.json to have a Local Sandbox configuration po '@ -$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME +$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME -workflowName 'localDevEnv' Write-Host "Checking System Requirements" $dockerProcess = (Get-Process "dockerd" -ErrorAction Ignore) @@ -129,7 +133,8 @@ CreateDevEnv ` -project $project ` -auth $auth ` -credential $credential ` - -licenseFileUrl $licenseFileUrl + -licenseFileUrl $licenseFileUrl ` + -accept_insiderEula:$accept_insiderEula } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)"