diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index cea11585c1..f3fd3a1746 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json", + "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json", "type": "PTE", "templateUrl": "https://github.com/microsoft/AL-Go-PTE@preview", "bcContainerHelperVersion": "latest", @@ -68,5 +68,5 @@ ], "UpdateALGoSystemFilesEnvironment": "Official-Build", "PullRequestTrigger": "pull_request", - "templateSha": "8edc212cf392aa985d35e99ae22756762607f974" + "templateSha": "87ad9f919052f78e0cc462d90fec1cf3c2e72c80" } diff --git a/.github/RELEASENOTES.copy.md b/.github/RELEASENOTES.copy.md index 51ca6406a1..ca8b72f0ce 100644 --- a/.github/RELEASENOTES.copy.md +++ b/.github/RELEASENOTES.copy.md @@ -2,6 +2,134 @@ Note that when using the preview version of AL-Go for GitHub, we recommend you Update your AL-Go system files, as soon as possible when informed that an update is available. +### Issues + +- Issue 1915 CICD fails on releases/26.x branch - '26.x' cannot be recognized as a semantic version string + +### The default pull request trigger is changing + +AL-Go for GitHub is transitioning from the pull_request_target trigger to the more secure pull_request trigger. This is a step we are taking to make AL-Go for GitHub more secure by default. If you are used to working from branches within the repository you may not notice any difference. If you get pull requests from forks, those pull requests will no longer be able to access secrets. If that is blocking for your repository, you will need to update your settings to use the pull_request_target trigger. + +**How do I revert back to pull_request_target?** + +Add the following setting to one of your settings files and run the Update AL-Go System Files workflow: + +```json + "pullRequestTrigger": "pull_request_target" +``` + +## v8.2 + +### Issues + +- Issue 2095 DeliverToAppSource.ProductId needs to be specified (Library app) +- Issue 2082 Sign action no longer fails when repository is empty or no artifacts are generated +- Issue 2078 Workflows run since January 14th '26 have space before CI/CD removed +- Issue 2070 Support public GitHub Packages feeds without requiring a Personal Access Token (PAT) +- Issue 2004 PublishToAppSource workflow publishes multi-app repos in alphabetical order instead of dependency order +- Issue 2045 DateTime parsing fails on non-US locale runners in WorkflowPostProcess.ps1 +- Issue 2055 When using versioningStrategy 3+16, you get an error when building +- Issue 2094 PR into release branch gets wrong previous release +- AL-Go repositories with large amounts of projects may run into issues with too large environment variables +- Discussion 1855 Add trigger 'workflow_call' to workflow 'Update AL-Go System Files' for reusability +- Issue 2050 Publish To Environment creates mistyped environment + +### Publish To Environment no longer creates unknown environments by default + +Previously, when running the "Publish To Environment" workflow with an environment name that doesn't exist in GitHub or AL-Go settings, the workflow would automatically create a new GitHub environment. This could lead to problems when environment names were mistyped, as the bogus environment would then cause subsequent CI/CD workflows to fail. + +Now, the workflow will fail with a clear error message if the specified environment doesn't exist. If you intentionally want to deploy to a new environment that hasn't been configured yet, you can check the **Create environment if it does not exist** checkbox when running the workflow. + +### Set default values for workflow inputs + +The `workflowDefaultInputs` setting now also applies to `workflow_call` inputs when an input with the same name exists for `workflow_dispatch`. +This ensures consistent default values across both manual workflow runs and reusable workflow calls. + +Read more at [workflowDefaultInputs](https://aka.ms/algosettings#workflowDefaultInputs). + +### Merge queue support + +AL-Go now supports GitHub's merge queue feature out of the box! The `merge_group` trigger has been added to the Pull Request Build workflow, enabling seamless integration with merge queues. When you have the merge queue feature enabled in your repo, multiple PRs will automatically be validated together. Read more about merge queues [here](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). + +> [!WARNING] +> If you rely on a custom workflow for merge queue validation, you may need to adjust your setup to avoid duplicate builds. + +### AL-Go Telemetry updates + +AL-Go telemetry now includes test results so you can more easily see how many AL tests, Page Scripting tests and BCPT tests ran in your workflows across all your repositories. Documentation for this can be found on [this article](https://github.com/microsoft/AL-Go/blob/main/Scenarios/EnablingTelemetry.md) on enabling telemetry. + +## v8.1 + +### Custom AL-Go files + +AL-Go for GitHub now supports updating files from your custom templates via the new `customALGoFiles` setting. Read more at [customALGoFiles](https://aka.ms/algosettings#customALGoFiles). + +### Set default values for workflow inputs + +A new setting `workflowDefaultInputs` allows you to configure default values for workflow_dispatch inputs. This makes it easier to run workflows manually with consistent settings across your team. + +When you add this setting to your AL-Go settings file and run the "Update AL-Go System Files" workflow, the default values will be automatically applied to the workflow YAML files in your repository. +The default values must match the input types (boolean, number, string, or choice) defined in the workflow YAML files. + +Example configuration: + +```json +{ + "workflowDefaultInputs": [ + { "name": "directCommit", "value": true }, + { "name": "useGhTokenWorkflow", "value": true } + ] +} +``` + +This setting can be used on its own in repository settings to apply defaults to all workflows with matching input names. Alternatively, you can use it within [conditional settings](https://aka.ms/algosettings#conditional-settings) to apply defaults only to specific workflows, branches, or other conditions. + +Example using conditional settings to target specific workflows: + +```json +{ + "conditionalSettings": [ + { + "workflows": ["Create Release"], + "settings": { + "workflowDefaultInputs": [ + { "name": "directCommit", "value": true }, + { "name": "releaseType", "value": "Prerelease" } + ] + } + } + ] +} +``` + +**Important:** When multiple conditional settings blocks match and both define `workflowDefaultInputs`, the arrays are merged following AL-Go's standard behavior for complex setting types (all entries are kept). If the same input name appears in multiple entries, the last matching entry takes precedence. + +Read more at [workflowDefaultInputs](https://aka.ms/algosettings#workflowDefaultInputs). + +### Issues + +- Issue 2039 Error when deploy to environment: NewTemporaryFolder is not recognized +- Issue 1961 KeyVault access in PR pipeline +- Discussion 1911 Add support for reportSuppressedDiagnostics +- Discussion 1968 Parameter for settings passed to CreateDevEnv +- Issue 1945 Deploy Reference Documentation fails for CI/CD +- Use Runner_Temp instead of GetTempFolder whenever possible +- Issue 2016 Running Update AL-Go system files with branches wildcard `*` tries to update _origin_ +- Issue 1960 Deploy Reference Documentation fails +- Discussion 1952 Set default values on workflow_dispatch input + +### Deprecations + +- `unusedALGoSystemFiles` will be removed after October 1st 2026. Please use [`customALGoFiles.filesToExclude`](https://aka.ms/algosettings#customALGoFiles) instead. + +## v8.0 + +### Mechanism to overwrite complex settings type + +By default, AL-Go merges settings from various places (see [settings levels](https://aka.ms/algosettings#where-are-the-settings-located)). Basic setting types such as `string` and `integer` are overwritten, but settings with complex types such as `array` and `object` are merged. + +However, sometimes it is useful to avoid merging complex types. This can be achieved by specifying `overwriteSettings` property on a settings object. The purpose of the property is to list settings, for which the value will be overwritten, instead of merged. Read more at [overwriteSettings property](https://aka.ms/algosettings#overwriteSettings) + ### AL Code Analysis tracked in GitHub AL-Go already supports AL code analysis, but up until now this was not tracked in GitHub. It is now possible to track code analysis issues automatically in the GitHub security tab, as well as having any new issues posted as a comment in Pull Requests. @@ -13,6 +141,14 @@ Please note that some automated features are premium and require the use of [Git ### Issues - Discussion 1885 Conditional settings for CI/CD are not applied +- Discussion 1899 Remove optional properties from "required" list in settings.schema.json +- Issue 1905 AL-Go system files update fails (Get Workflow Multi-Run Branches action fails when there are tags with same value but different casing) +- Issue 1926 Deployment fails when using build modes +- Issue 1898 GetDependencies in localDevEnv does not fallback to github token +- Issue 1947 Project settings are ignored when loading bccontainerhelper +- Issue 1937 trackALAlertsInGitHub is failing in preview +- DeployTo settings from environment-specific AL-Go settings are not applied when deploying +- `ReadSettings` action outputs too much information that is mainly used for debugging ## v7.3 @@ -35,7 +171,7 @@ Example AL-Go now offers a dataexplorer dashboard to get started with AL-Go telemetry. Additionally, we've updated the documentation to include a couple of kusto queries if you would rather build your own reports. -### Support for AL-Go settings as GitHub environment variable: ALGoEnvSettings +### Support for AL-Go settings as GitHub environment variable: ALGoEnvironmentSettings AL-Go settings can now be defined in GitHub environment variables. To use this feature, create a new variable under your GitHub environment called `ALGoEnvironmentSettings`. Please note that this variable should not include your environment name. @@ -905,7 +1041,7 @@ Setting the repo setting "runs-on" to "Ubuntu-latest", followed by running Updat ### Issues - Issue #143 Commit Message for **Increment Version Number** workflow -- Issue #160 Create local DevEnv aith appDependencyProbingPaths +- Issue #160 Create local DevEnv with appDependencyProbingPaths - Issue #156 Versioningstrategy 2 doesn't use 24h format - Issue #155 Initial Add existing app fails with "Cannot find path" - Issue #152 Error when loading dependencies from releases diff --git a/.github/Test Next Major.settings.json b/.github/Test Next Major.settings.json index 407df767a7..daeceb4938 100644 --- a/.github/Test Next Major.settings.json +++ b/.github/Test Next Major.settings.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/settings.schema.json", + "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json", "*": null } diff --git a/.github/Test Next Minor.settings.json b/.github/Test Next Minor.settings.json index 407df767a7..daeceb4938 100644 --- a/.github/Test Next Minor.settings.json +++ b/.github/Test Next Minor.settings.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/settings.schema.json", + "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json", "*": null } diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index 732abeb2c2..2ba128ddb9 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -15,9 +15,10 @@ permissions: id-token: write pages: read security-events: write + packages: read env: - workflowDepth: 2 + workflowDepth: 1 ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} @@ -43,41 +44,41 @@ jobs: baselineWorkflowSHA: ${{ steps.determineProjectsToBuild.outputs.BaselineWorkflowSHA }} workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} powerPlatformSolutionFolder: ${{ steps.DeterminePowerPlatformSolutionFolder.outputs.powerPlatformSolutionFolder }} - trackALAlertsInGithub: ${{ steps.SetALCodeAnalysisVar.outputs.trackALAlertsInGithub }} + trackALAlertsInGitHub: ${{ steps.SetALCodeAnalysisVar.outputs.trackALAlertsInGitHub }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: true - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowInitialize@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - get: type,powerPlatformSolutionFolder,useGitSubmodules,trackALAlertsInGithub + get: type,powerPlatformSolutionFolder,useGitSubmodules,trackALAlertsInGitHub - name: Set AL Code Analysis Var output id: SetALCodeAnalysisVar run: | - Write-Host "trackALAlertsInGithub environment variable: '$($env:trackALAlertsInGithub)'" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "trackALAlertsInGithub=$($env:trackALAlertsInGithub)" + Write-Host "trackALAlertsInGitHub environment variable: '$($env:trackALAlertsInGitHub)'" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "trackALAlertsInGitHub=$($env:trackALAlertsInGitHub)" - name: Read submodules token id: ReadSubmodulesToken if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -85,7 +86,7 @@ jobs: - name: Checkout Submodules if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: true submodules: ${{ env.useGitSubmodules }} @@ -98,7 +99,7 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} @@ -111,7 +112,7 @@ jobs: - name: Determine Delivery Target Secrets id: DetermineDeliveryTargetSecrets - uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}' @@ -119,7 +120,7 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -127,7 +128,7 @@ jobs: - name: Determine Delivery Targets id: DetermineDeliveryTargets - uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineDeliveryTargets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -137,7 +138,7 @@ jobs: - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -150,24 +151,24 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell get: templateUrl - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: 'ghTokenWorkflow' - name: Check for updates to AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/CheckForUpdates@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -176,7 +177,7 @@ jobs: token: ${{ fromJson(steps.ReadSecrets.outputs.Secrets).ghTokenWorkflow }} downloadLatest: true - Build1: + Build: needs: [ Initialization ] if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0 strategy: @@ -201,58 +202,33 @@ jobs: useArtifactCache: true needsContext: ${{ toJson(needs) }} - Build: - needs: [ Initialization, Build1 ] - if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0 - strategy: - matrix: - include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }} - fail-fast: false - name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }}) - uses: ./.github/workflows/_BuildALGoProject.yaml - secrets: inherit - with: - 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' - signArtifacts: true - useArtifactCache: true - needsContext: ${{ toJson(needs) }} - CodeAnalysisUpload: needs: [ Initialization, Build ] - if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGithub == 'True') + if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGitHub == 'True') runs-on: [ windows-latest ] name: Code Analysis Processing steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Download artifacts - ErrorLogs - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 if: (success() || failure()) with: - pattern: '*-ErrorLogs-*' + pattern: '*-*ErrorLogs-*' path: '${{ github.workspace }}/ErrorLogs/' - merge_multiple: true + merge-multiple: true - name: Process AL Code Analysis Logs id: ProcessALCodeAnalysisLogs if: (success() || failure()) - uses: microsoft/AL-Go/Actions/ProcessALCodeAnalysisLogs@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ProcessALCodeAnalysisLogs@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Upload SARIF file to GitHub - uses: github/codeql-action/upload-sarif@v3 - if: always() + uses: github/codeql-action/upload-sarif@v4 + if: (success() || failure()) && (hashFiles(format('{0}/ErrorLogs/output.sarif.json',github.workspace)) != '') with: sarif_file: '${{ github.workspace }}/ErrorLogs/output.sarif.json' category: "ALCodeAnalysis" @@ -272,15 +248,21 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Download artifacts - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 + with: + shell: powershell + + - name: Determine ArtifactUrl + id: determineArtifactUrl + uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell @@ -289,10 +271,11 @@ jobs: uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - name: Build Reference Documentation - uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell artifacts: '.artifacts' + artifactUrl: ${{ env.artifact }} - name: Upload pages artifact uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 @@ -305,8 +288,8 @@ jobs: uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 Deploy: - needs: [ Initialization, Build1, Build ] - if: (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0 + needs: [ Initialization, Build ] + if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.environmentCount > 0 strategy: ${{ fromJson(needs.Initialization.outputs.environmentsMatrixJson) }} runs-on: ${{ fromJson(matrix.os) }} name: Deploy to ${{ matrix.environment }} @@ -321,15 +304,15 @@ jobs: ALGoEnvName: ${{ matrix.environment }} steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Download artifacts - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ matrix.shell }} get: type,powerPlatformSolutionFolder @@ -343,7 +326,7 @@ jobs: - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ matrix.shell }} gitHubSecrets: ${{ toJson(secrets) }} @@ -351,7 +334,7 @@ jobs: - name: Deploy to Business Central id: Deploy - uses: microsoft/AL-Go/Actions/Deploy@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/Deploy@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -363,7 +346,7 @@ jobs: - name: Deploy to Power Platform if: env.type == 'PTE' && env.powerPlatformSolutionFolder != '' - uses: microsoft/AL-Go/Actions/DeployPowerPlatform@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DeployPowerPlatform@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -373,8 +356,8 @@ jobs: deploymentEnvironmentsJson: ${{ needs.Initialization.outputs.deploymentEnvironmentsJson }} Deliver: - needs: [ Initialization, Build1, Build ] - if: (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]' + needs: [ Initialization, Build ] + if: (!cancelled()) && (needs.Build.result == 'success' || needs.Build.result == 'skipped') && needs.Initialization.outputs.deliveryTargetsJson != '[]' strategy: matrix: deliveryTarget: ${{ fromJson(needs.Initialization.outputs.deliveryTargetsJson) }} @@ -383,28 +366,28 @@ jobs: name: Deliver to ${{ matrix.deliveryTarget }} steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Download artifacts - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: path: '.artifacts' - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} getSecrets: '${{ matrix.deliveryTarget }}Context' - name: Deliver - uses: microsoft/AL-Go/Actions/Deliver@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/Deliver@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -415,16 +398,16 @@ jobs: artifacts: '.artifacts' PostProcess: - needs: [ Initialization, Build1, Build, Deploy, Deliver, DeployALDoc ] + needs: [ Initialization, Build, Deploy, Deliver, DeployALDoc, CodeAnalysisUpload ] if: (!cancelled()) runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: diff --git a/.github/workflows/DeployReferenceDocumentation.yaml b/.github/workflows/DeployReferenceDocumentation.yaml index 92f9b1ba83..b1e1a3bbdd 100644 --- a/.github/workflows/DeployReferenceDocumentation.yaml +++ b/.github/workflows/DeployReferenceDocumentation.yaml @@ -26,22 +26,28 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowInitialize@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 + with: + shell: powershell + + - name: Determine ArtifactUrl + id: determineArtifactUrl + uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Determine Deployment Environments id: DetermineDeploymentEnvironments - uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineDeploymentEnvironments@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -54,10 +60,11 @@ jobs: uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - name: Build Reference Documentation - uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/BuildReferenceDocumentation@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell artifacts: 'latest' + artifactUrl: ${{ env.artifact }} - name: Upload pages artifact uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 @@ -71,7 +78,7 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: diff --git a/.github/workflows/PullRequestHandler.yaml b/.github/workflows/PullRequestHandler.yaml index c112bf52d0..3fde43b99a 100644 --- a/.github/workflows/PullRequestHandler.yaml +++ b/.github/workflows/PullRequestHandler.yaml @@ -3,9 +3,10 @@ name: 'Pull Request Build' on: pull_request: branches: [ 'main' ] + merge_group: concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event_name == 'merge_group' && github.run_id || github.event.pull_request.number }} cancel-in-progress: true defaults: @@ -18,9 +19,10 @@ permissions: id-token: write pull-requests: read security-events: write + packages: read env: - workflowDepth: 2 + workflowDepth: 1 ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} ALGoRepoSettings: ${{ vars.ALGoRepoSettings }} @@ -29,7 +31,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: microsoft/AL-Go/Actions/VerifyPRChanges@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + - uses: microsoft/AL-Go/Actions/VerifyPRChanges@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 Initialization: needs: [ PregateCheck ] @@ -44,37 +46,37 @@ jobs: workflowDepth: ${{ steps.DetermineWorkflowDepth.outputs.WorkflowDepth }} artifactsRetentionDays: ${{ steps.DetermineWorkflowDepth.outputs.ArtifactsRetentionDays }} telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }} - trackALAlertsInGithub: ${{ steps.SetALCodeAnalysisVar.outputs.trackALAlertsInGithub }} + trackALAlertsInGitHub: ${{ steps.SetALCodeAnalysisVar.outputs.trackALAlertsInGitHub }} steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: true - ref: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} + ref: ${{ github.event_name == 'pull_request' && github.sha || github.event_name == 'merge_group' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowInitialize@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - get: shortLivedArtifactsRetentionDays,trackALAlertsInGithub + get: shortLivedArtifactsRetentionDays,trackALAlertsInGitHub - name: Set AL Code Analysis Var output id: SetALCodeAnalysisVar run: | - Write-Host "trackALAlertsInGithub environment variable: '$($env:trackALAlertsInGithub)'" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "trackALAlertsInGithub=$($env:trackALAlertsInGithub)" + Write-Host "trackALAlertsInGitHub environment variable: '$($env:trackALAlertsInGitHub)'" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "trackALAlertsInGitHub=$($env:trackALAlertsInGitHub)" - name: Determine Workflow Depth id: DetermineWorkflowDepth @@ -84,12 +86,12 @@ jobs: - name: Determine Projects To Build id: determineProjectsToBuild - uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineProjectsToBuild@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell maxBuildDepth: ${{ env.workflowDepth }} - Build1: + Build: needs: [ Initialization ] if: (!failure()) && (!cancelled()) && fromJson(needs.Initialization.outputs.buildOrderJson)[0].projectsCount > 0 strategy: @@ -102,33 +104,7 @@ jobs: with: 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' - artifactsRetentionDays: ${{ fromJson(needs.Initialization.outputs.artifactsRetentionDays) }} - artifactsNameSuffix: 'PR${{ github.event.number }}' - needsContext: ${{ toJson(needs) }} - useArtifactCache: true - - Build: - needs: [ Initialization, Build1 ] - if: (!failure()) && (!cancelled()) && (needs.Build1.result == 'success' || needs.Build1.result == 'skipped') && fromJson(needs.Initialization.outputs.buildOrderJson)[1].projectsCount > 0 - strategy: - matrix: - include: ${{ fromJson(needs.Initialization.outputs.buildOrderJson)[1].buildDimensions }} - fail-fast: false - name: Build ${{ matrix.projectName }} (${{ matrix.buildMode }}) - uses: ./.github/workflows/_BuildALGoProject.yaml - secrets: inherit - with: - shell: ${{ matrix.githubRunnerShell }} - runsOn: ${{ matrix.githubRunner }} - checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }} + checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || github.event_name == 'merge_group' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} project: ${{ matrix.project }} projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} @@ -143,33 +119,33 @@ jobs: CodeAnalysisUpload: needs: [ Initialization, Build ] - if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGithub == 'True') + if: (!cancelled()) && (needs.Initialization.outputs.trackALAlertsInGitHub == 'True') && (github.event_name != 'merge_group') runs-on: [ windows-latest ] name: Code Analysis Processing steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ format('refs/pull/{0}/head', github.event.pull_request.number) }} - name: Download artifacts - ErrorLogs - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 if: (success() || failure()) with: - pattern: '*-ErrorLogs-*' + pattern: '*-*ErrorLogs-*' path: '${{ github.workspace }}/ErrorLogs/' - merge_multiple: true + merge-multiple: true - name: Process AL Code Analysis Logs id: ProcessALCodeAnalysisLogs if: (success() || failure()) - uses: microsoft/AL-Go/Actions/ProcessALCodeAnalysisLogs@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ProcessALCodeAnalysisLogs@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Upload SARIF file to GitHub - uses: github/codeql-action/upload-sarif@v3 - if: always() + uses: github/codeql-action/upload-sarif@v4 + if: (success() || failure()) && (hashFiles(format('{0}/ErrorLogs/output.sarif.json',github.workspace)) != '') with: sarif_file: '${{ github.workspace }}/ErrorLogs/output.sarif.json' category: "ALCodeAnalysis" @@ -184,7 +160,7 @@ jobs: steps: - name: Pull Request Status Check id: PullRequestStatusCheck - uses: microsoft/AL-Go/Actions/PullRequestStatusCheck@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/PullRequestStatusCheck@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -192,7 +168,7 @@ jobs: - name: Finalize the workflow id: PostProcess - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 if: success() || failure() env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/Troubleshooting.yaml b/.github/workflows/Troubleshooting.yaml index ab73e2e915..92797723cd 100644 --- a/.github/workflows/Troubleshooting.yaml +++ b/.github/workflows/Troubleshooting.yaml @@ -25,12 +25,12 @@ jobs: runs-on: [ windows-latest ] steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: true - name: Troubleshooting - uses: microsoft/AL-Go/Actions/Troubleshooting@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/Troubleshooting@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} diff --git a/.github/workflows/UpdateGitHubGoSystemFiles.yaml b/.github/workflows/UpdateGitHubGoSystemFiles.yaml index 046d2082f8..4d03cbb8ff 100644 --- a/.github/workflows/UpdateGitHubGoSystemFiles.yaml +++ b/.github/workflows/UpdateGitHubGoSystemFiles.yaml @@ -19,6 +19,26 @@ on: 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: '' + workflow_call: + inputs: + templateUrl: + description: Template Repository URL (current is https://github.com/microsoft/AL-Go-PTE@preview) + type: string + required: false + default: '' + downloadLatest: + description: Download latest from template repository + type: boolean + default: true + directCommit: + 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. + type: string + required: false + default: '' permissions: actions: read @@ -42,18 +62,18 @@ jobs: TemplateUrl: ${{ steps.DetermineTemplateUrl.outputs.TemplateUrl }} steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Read settings id: ReadSettings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell get: templateUrl - name: Get Workflow Multi-Run Branches id: GetBranches - uses: microsoft/AL-Go/Actions/GetWorkflowMultiRunBranches@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/GetWorkflowMultiRunBranches@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell includeBranches: ${{ github.event.inputs.includeBranches }} @@ -83,30 +103,30 @@ jobs: steps: - name: Dump Workflow Information - uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DumpWorkflowInfo@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ matrix.branch }} - name: Initialize the workflow id: init - uses: microsoft/AL-Go/Actions/WorkflowInitialize@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowInitialize@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell get: commitOptions - name: Read secrets id: ReadSecrets - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: powershell gitHubSecrets: ${{ toJson(secrets) }} @@ -118,8 +138,8 @@ jobs: downloadLatest: '${{ github.event.inputs.downloadLatest }}' run: | $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - if('${{ github.event_name }}' -eq 'workflow_dispatch') { - Write-Host "Using inputs from workflow_dispatch event" + if('${{ github.event_name }}' -in 'workflow_dispatch', 'workflow_call') { + Write-Host "Using inputs from ${{ github.event_name }} event" $directCommit = $env:directCommit $downloadLatest = $env:downloadLatest } @@ -133,7 +153,7 @@ jobs: Add-Content -Encoding UTF8 -Path $env:GITHUB_ENV -Value "downloadLatest=$downloadLatest" - name: Update AL-Go system files - uses: microsoft/AL-Go/Actions/CheckForUpdates@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/CheckForUpdates@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: @@ -147,7 +167,7 @@ jobs: - name: Finalize the workflow if: always() - uses: microsoft/AL-Go/Actions/WorkflowPostProcess@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/WorkflowPostProcess@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: GITHUB_TOKEN: ${{ github.token }} with: diff --git a/.github/workflows/_BuildALGoProject.yaml b/.github/workflows/_BuildALGoProject.yaml index f7f3179ddb..c8ecc1634a 100644 --- a/.github/workflows/_BuildALGoProject.yaml +++ b/.github/workflows/_BuildALGoProject.yaml @@ -82,6 +82,7 @@ permissions: actions: read contents: read id-token: write + packages: read env: ALGoOrgSettings: ${{ vars.ALGoOrgSettings }} @@ -97,22 +98,22 @@ jobs: name: ${{ inputs.projectName }} (${{ inputs.buildMode }}) steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ inputs.checkoutRef }} lfs: true - name: Read settings - uses: microsoft/AL-Go/Actions/ReadSettings@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/ReadSettings@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} buildMode: ${{ inputs.buildMode }} - get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,doNotRunBcptTests,doNotRunpageScriptingTests,artifact,generateDependencyArtifact,trustedSigning,useGitSubmodules,trackALAlertsInGithub + get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,doNotRunBcptTests,doNotRunpageScriptingTests,artifact,generateDependencyArtifact,trustedSigning,useGitSubmodules,trackALAlertsInGitHub - name: Determine whether to build project id: DetermineBuildProject - uses: microsoft/AL-Go/Actions/DetermineBuildProject@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineBuildProject@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} skippedProjectsJson: ${{ inputs.skippedProjectsJson }} @@ -121,8 +122,8 @@ jobs: - name: Read secrets id: ReadSecrets - if: steps.DetermineBuildProject.outputs.BuildIt == 'True' && github.event_name != 'pull_request' - uses: microsoft/AL-Go/Actions/ReadSecrets@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + if: steps.DetermineBuildProject.outputs.BuildIt == 'True' + uses: microsoft/AL-Go/Actions/ReadSecrets@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} gitHubSecrets: ${{ toJson(secrets) }} @@ -130,7 +131,7 @@ jobs: - name: Checkout Submodules if: env.useGitSubmodules != 'false' && env.useGitSubmodules != '' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ inputs.checkoutRef }} lfs: true @@ -140,14 +141,14 @@ jobs: - name: Determine ArtifactUrl id: determineArtifactUrl if: steps.DetermineBuildProject.outputs.BuildIt == 'True' - uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DetermineArtifactUrl@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} - name: Cache Business Central Artifacts if: steps.DetermineBuildProject.outputs.BuildIt == 'True' && env.useCompilerFolder == 'True' && inputs.useArtifactCache && env.artifactCacheKey - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: ${{ runner.temp }}/.artifactcache key: ${{ env.artifactCacheKey }} @@ -155,7 +156,7 @@ jobs: - name: Download Project Dependencies id: DownloadProjectDependencies if: steps.DetermineBuildProject.outputs.BuildIt == 'True' - uses: microsoft/AL-Go/Actions/DownloadProjectDependencies@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/DownloadProjectDependencies@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: @@ -166,7 +167,7 @@ jobs: baselineWorkflowRunId: ${{ inputs.baselineWorkflowRunId }} - name: Build - uses: microsoft/AL-Go/Actions/RunPipeline@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/RunPipeline@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 if: steps.DetermineBuildProject.outputs.BuildIt == 'True' env: Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' @@ -184,8 +185,8 @@ jobs: - name: Sign id: sign - 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@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + 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 != '')) && (hashFiles(format('{0}/.buildartifacts/Apps/*.app',inputs.project)) != '') + uses: microsoft/AL-Go/Actions/Sign@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} azureCredentialsJson: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).AZURE_CREDENTIALS }}' @@ -193,7 +194,7 @@ jobs: - name: Calculate Artifact names id: calculateArtifactsNames - uses: microsoft/AL-Go/Actions/CalculateArtifactNames@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/CalculateArtifactNames@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 if: success() || failure() with: shell: ${{ inputs.shell }} @@ -202,7 +203,7 @@ jobs: suffix: ${{ inputs.artifactsNameSuffix }} - name: Publish artifacts - apps - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: inputs.artifactsRetentionDays >= 0 && (hashFiles(format('{0}/.buildartifacts/Apps/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.AppsArtifactsName }} @@ -211,7 +212,7 @@ jobs: retention-days: ${{ inputs.artifactsRetentionDays }} - name: Publish artifacts - dependencies - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: inputs.artifactsRetentionDays >= 0 && env.generateDependencyArtifact == 'True' && (hashFiles(format('{0}/.buildartifacts/Dependencies/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} @@ -220,7 +221,7 @@ jobs: retention-days: ${{ inputs.artifactsRetentionDays }} - name: Publish artifacts - test apps - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: inputs.artifactsRetentionDays >= 0 && (hashFiles(format('{0}/.buildartifacts/TestApps/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.TestAppsArtifactsName }} @@ -229,7 +230,7 @@ jobs: retention-days: ${{ inputs.artifactsRetentionDays }} - name: Publish artifacts - build output - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: (success() || failure()) && (hashFiles(format('{0}/BuildOutput.txt',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.BuildOutputArtifactsName }} @@ -237,7 +238,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - container event log - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: (failure()) && (hashFiles(format('{0}/ContainerEventLog.evtx',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.ContainerEventLogArtifactsName }} @@ -245,7 +246,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - test results - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/TestResults.xml',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.TestResultsArtifactsName }} @@ -253,7 +254,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - bcpt test results - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/bcptTestResults.json',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.BcptTestResultsArtifactsName }} @@ -261,7 +262,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - page scripting test results - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/PageScriptingTestResults.xml',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.PageScriptingTestResultsArtifactsName }} @@ -269,7 +270,7 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - page scripting test result details - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 if: (success() || failure()) && (hashFiles(format('{0}/.buildartifacts/PageScriptingTestResultDetails/*',inputs.project)) != '') with: name: ${{ steps.calculateArtifactsNames.outputs.PageScriptingTestResultDetailsArtifactsName }} @@ -277,8 +278,8 @@ jobs: if-no-files-found: ignore - name: Publish artifacts - ErrorLogs - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: inputs.artifactsRetentionDays >= 0 && (hashFiles(format('{0}/.buildartifacts/ErrorLogs/*',inputs.project)) != '') && env.trackALAlertsInGithub == 'True' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + if: (success() || failure()) && inputs.artifactsRetentionDays >= 0 && (hashFiles(format('{0}/.buildartifacts/ErrorLogs/*',inputs.project)) != '') && env.trackALAlertsInGitHub == 'True' with: name: ${{ steps.calculateArtifactsNames.outputs.ErrorLogsArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/ErrorLogs/' @@ -288,7 +289,7 @@ jobs: - name: Analyze Test Results id: analyzeTestResults if: (success() || failure()) && env.doNotRunTests == 'False' - uses: microsoft/AL-Go/Actions/AnalyzeTests@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/AnalyzeTests@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} @@ -297,7 +298,7 @@ jobs: - name: Analyze BCPT Test Results id: analyzeTestResultsBCPT if: (success() || failure()) && env.doNotRunBcptTests == 'False' - uses: microsoft/AL-Go/Actions/AnalyzeTests@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/AnalyzeTests@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} @@ -306,7 +307,7 @@ jobs: - name: Analyze Page Scripting Test Results id: analyzeTestResultsPageScripting if: (success() || failure()) && env.doNotRunpageScriptingTests == 'False' - uses: microsoft/AL-Go/Actions/AnalyzeTests@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/AnalyzeTests@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} @@ -314,7 +315,7 @@ jobs: - name: Cleanup if: always() && steps.DetermineBuildProject.outputs.BuildIt == 'True' - uses: microsoft/AL-Go/Actions/PipelineCleanup@32e66d69cfd2c1e3eca39e416e27c6aa58de6df3 + uses: microsoft/AL-Go/Actions/PipelineCleanup@0c7b1de38ba518aaf5fdee3902c2d2ae886ede32 with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} diff --git a/Build/projects/1st Party Apps (W1)/.AL-Go/cloudDevEnv.ps1 b/Build/projects/1st Party Apps (W1)/.AL-Go/cloudDevEnv.ps1 index 1e977213f9..7338e92b58 100644 --- a/Build/projects/1st Party Apps (W1)/.AL-Go/cloudDevEnv.ps1 +++ b/Build/projects/1st Party Apps (W1)/.AL-Go/cloudDevEnv.ps1 @@ -1,13 +1,103 @@ -# -# Script for creating cloud development environment -# Please do not modify this script as it will be auto-updated from the AL-Go Template -# Recommended approach is to use as is or add a script (freddyk-devenv.ps1), which calls this script with the user specific parameters -# +<# +.SYNOPSIS + Creates a cloud-based development environment for Business Central AL development using SaaS Sandbox. + +.DESCRIPTION + This script sets up a cloud-based development environment by: + - Creating a Business Central SaaS Sandbox environment + - Compiling and publishing all apps and test apps to the development scope + - Configuring launch.json for Visual Studio Code with Cloud Sandbox configuration + - Optionally applying custom settings to override repository settings + + The script will prompt you interactively for authentication using device code flow. + For automated/unattended execution, you can configure AdminCenterApiCredentials as a GitHub secret + or in Azure KeyVault. See https://aka.ms/algosettings for more information about AdminCenterApiCredentials. + + This is an alternative to localDevEnv.ps1 for users who cannot run Docker containers locally. + + RECOMMENDED USAGE: + Instead of modifying this script directly (which will be overwritten during AL-Go updates), + create a custom script that calls this one with your preferred parameters. For example, + create a file named after yourself (e.g., 'john-devenv.ps1') that contains: + + # My personal cloud development environment script + $mySettings = '{"country":"us"}' + . .\.AL-Go\cloudDevEnv.ps1 -environmentName "john-sandbox" -reuseExistingEnvironment $true -customSettings $mySettings + + This approach allows you to: + - Maintain your personal preferences without losing them during updates + - Share your setup with team members + - Version control your custom development configurations + - Easily switch between different development scenarios + +.PARAMETER environmentName + The name of the cloud sandbox environment to create or reuse. + If not specified, the script will prompt for input with a default of "{username}-sandbox". + +.PARAMETER reuseExistingEnvironment + Boolean parameter indicating whether to reuse an existing environment with the same name. + If $true, the script will use the existing environment if it exists. + If $false, the script will recreate the environment (deleting the old one if it exists). + If not specified, the script will prompt the user to select the behavior. + +.PARAMETER fromVSCode + Switch parameter indicating the script is being run from Visual Studio Code. + When specified, the script will pause at the end waiting for user input before closing. + +.PARAMETER clean + Switch parameter to create a clean development environment without compiling and publishing apps. + Useful for setting up a fresh environment without deploying any applications. + +.PARAMETER customSettings + JSON string containing custom settings that override repository settings. + These settings have the highest precedence and can be used to override country, + or other configuration without modifying repository files. + +.EXAMPLE + .\cloudDevEnv.ps1 + Runs the script interactively, prompting for all required parameters. + +.EXAMPLE + .\cloudDevEnv.ps1 -environmentName "my-sandbox" -reuseExistingEnvironment $true + Creates or reuses a cloud sandbox named "my-sandbox". + +.EXAMPLE + .\cloudDevEnv.ps1 -clean + Creates a clean cloud development environment without compiling and publishing apps. + +.EXAMPLE + .\cloudDevEnv.ps1 -customSettings '{"country":"dk"}' + Creates a cloud development environment with custom settings for Denmark country. + +.EXAMPLE + # Programmatic setup with custom settings + $envName = "test-sandbox" + $settings = '{"country": "us"}' + + . ./cloudDevEnv.ps1 -environmentName $envName -reuseExistingEnvironment $true -customSettings $settings + + Creates or reuses a cloud development environment with custom country setting. + +.NOTES + - Authentication is handled interactively via device code flow (https://aka.ms/devicelogin) + - For unattended execution, configure AdminCenterApiCredentials secret (see link below) + - Does not require Docker to be installed + - Script automatically downloads required AL-Go helper modules and actions + - Modifies launch.json in VS Code workspace for Cloud Sandbox configuration + - Custom settings parameter allows runtime override of repository settings + - If NewBcContainer.ps1 override exists, cloud development may not be supported + +.LINK + https://aka.ms/algosettings - AL-Go Settings Documentation + https://github.com/microsoft/AL-Go/blob/main/Scenarios/CreateOnlineDevEnv2.md - Online Dev Environment Setup +#> + Param( [string] $environmentName = "", [bool] $reuseExistingEnvironment, [switch] $fromVSCode, - [switch] $clean + [switch] $clean, + [string] $customSettings = "" ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 @@ -51,12 +141,12 @@ Write-Host -ForegroundColor Yellow @' $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/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt -$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder -$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder -$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/AL-Go-Helper.ps1' -folder $tmpFolder -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null +$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt +$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder +$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder +$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/AL-Go-Helper.ps1' -folder $tmpFolder +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null Import-Module $GitHubHelperPath Import-Module $ReadSettingsModule @@ -103,7 +193,8 @@ CreateDevEnv ` -reuseExistingEnvironment:$reuseExistingEnvironment ` -baseFolder $baseFolder ` -project $project ` - -clean:$clean + -clean:$clean ` + -customSettings $customSettings } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/Build/projects/1st Party Apps (W1)/.AL-Go/localDevEnv.ps1 b/Build/projects/1st Party Apps (W1)/.AL-Go/localDevEnv.ps1 index 925b12bafc..b54fad4b82 100644 --- a/Build/projects/1st Party Apps (W1)/.AL-Go/localDevEnv.ps1 +++ b/Build/projects/1st Party Apps (W1)/.AL-Go/localDevEnv.ps1 @@ -1,8 +1,106 @@ -# -# Script for creating local development environment -# Please do not modify this script as it will be auto-updated from the AL-Go Template -# Recommended approach is to use as is or add a script (freddyk-devenv.ps1), which calls this script with the user specific parameters -# +<# +.SYNOPSIS + Creates a local development environment for Business Central AL development using Docker containers. + +.DESCRIPTION + This script sets up a local development environment by: + - Creating a Business Central container using Docker + - Compiling and publishing all apps and test apps to the development scope + - Configuring launch.json for Visual Studio Code with Local Sandbox configuration + - Optionally applying custom settings to override repository settings + + The script requires Docker to be installed and configured to run Windows containers. + If Docker setup fails, users can alternatively run cloudDevEnv.ps1 for cloud-based development. + + RECOMMENDED USAGE: + Instead of modifying this script directly (which will be overwritten during AL-Go updates), + create a custom script that calls this one with your preferred parameters. For example, + create a file named after yourself (e.g., 'john-devenv.ps1') that contains: + + # My personal development environment script + $mySettings = '{"country":"us","artifact":"////nextminor"}' + . .\.AL-Go\localDevEnv.ps1 -containerName "mydevenv" -auth UserPassword -customSettings $mySettings + + This approach allows you to: + - Maintain your personal preferences without losing them during updates + - Share your setup with team members + - Version control your custom development configurations + - Easily switch between different development scenarios + +.PARAMETER containerName + The name of the Docker container to create. If not specified, the script will prompt for input. + Default prompts for "bcserver" if not provided. + +.PARAMETER auth + Authentication mechanism for the container. Valid values are "UserPassword" or "Windows". + If not specified, the script will prompt the user to select the authentication method. + +.PARAMETER credential + PSCredential object containing username and password for container authentication. + If not provided, the script will prompt for credentials based on the selected auth method. + +.PARAMETER licenseFileUrl + Local path or secure download URL to a Business Central license file. + For AppSource apps targeting BC versions prior to 22, a developer license with object ID permissions is required. + For PTEs, this is optional but can be useful for dependent app object IDs. + Set to "none" to skip license file input. + +.PARAMETER fromVSCode + Switch parameter indicating the script is being run from Visual Studio Code. + When specified, the script will pause at the end waiting for user input before closing. + +.PARAMETER accept_insiderEula + Switch parameter to automatically accept the insider EULA when using Business Central insider builds. + Required when working with insider artifacts. + +.PARAMETER clean + Switch parameter to create a clean development environment without compiling and publishing apps. + Useful for setting up a fresh container without deploying any applications. + +.PARAMETER customSettings + JSON string containing custom settings that override repository settings. + These settings have the highest precedence and can be used to override artifact URLs, + country settings, or other configuration without modifying repository files. + +.EXAMPLE + .\localDevEnv.ps1 + Runs the script interactively, prompting for all required parameters. + +.EXAMPLE + .\localDevEnv.ps1 -containerName "mydevenv" -auth "UserPassword" + Creates a container named "mydevenv" with username/password authentication, prompting for credentials and LicenseFile. + +.EXAMPLE + .\localDevEnv.ps1 -clean + Creates a clean development environment without compiling and publishing apps. + +.EXAMPLE + .\localDevEnv.ps1 -customSettings '{"country":"dk","artifact":"////nextminor"}' + Creates a development environment with custom settings for Denmark country and specific artifact. + +.EXAMPLE + # Programmatic setup with credentials and custom settings + $Username = "SUPER" + $Password = "" + $cred = New-Object System.Management.Automation.PSCredential ($Username, (ConvertTo-SecureString $Password -AsPlainText -Force)) + $containerName = "bcserver" + $settings = '{"artifact": "////nextminor"}' + + . ./localDevEnv.ps1 -containerName $containerName -auth UserPassword -credential $cred -accept_insiderEula -licenseFileUrl "none" -customSettings $settings + + Creates a development environment with predefined credentials, using next minor version artifact, accepting insider EULA, and no license file. + +.NOTES + - Requires Docker Desktop to be installed and running with Windows container support + - For AppSource apps, may require a developer license for BC versions prior to 22 + - Script automatically downloads required AL-Go helper modules and actions + - Modifies launch.json in VS Code workspace for Local Sandbox configuration + - Custom settings parameter allows runtime override of repository settings + +.LINK + https://aka.ms/algosettings - AL-Go Settings Documentation +#> + Param( [string] $containerName = "", [ValidateSet("UserPassword", "Windows")] @@ -11,7 +109,8 @@ Param( [string] $licenseFileUrl = "", [switch] $fromVSCode, [switch] $accept_insiderEula, - [switch] $clean + [switch] $clean, + [string] $customSettings = "" ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 @@ -55,12 +154,12 @@ Write-Host -ForegroundColor Yellow @' $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/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt -$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder -$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder -$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/AL-Go-Helper.ps1' -folder $tmpFolder -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null +$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt +$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder +$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder +$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/AL-Go-Helper.ps1' -folder $tmpFolder +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null Import-Module $GitHubHelperPath Import-Module $ReadSettingsModule @@ -160,7 +259,8 @@ CreateDevEnv ` -credential $credential ` -licenseFileUrl $licenseFileUrl ` -accept_insiderEula:$accept_insiderEula ` - -clean:$clean + -clean:$clean ` + -customSettings $customSettings } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json b/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json index 87ab7c532a..f89b53021e 100644 --- a/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json +++ b/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json", + "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json", "projectName": "1st Party Apps (W1)", "appFolders": [ "..\\..\\..\\Apps\\W1\\*\\app", diff --git a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/cloudDevEnv.ps1 b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/cloudDevEnv.ps1 index 1e977213f9..7338e92b58 100644 --- a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/cloudDevEnv.ps1 +++ b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/cloudDevEnv.ps1 @@ -1,13 +1,103 @@ -# -# Script for creating cloud development environment -# Please do not modify this script as it will be auto-updated from the AL-Go Template -# Recommended approach is to use as is or add a script (freddyk-devenv.ps1), which calls this script with the user specific parameters -# +<# +.SYNOPSIS + Creates a cloud-based development environment for Business Central AL development using SaaS Sandbox. + +.DESCRIPTION + This script sets up a cloud-based development environment by: + - Creating a Business Central SaaS Sandbox environment + - Compiling and publishing all apps and test apps to the development scope + - Configuring launch.json for Visual Studio Code with Cloud Sandbox configuration + - Optionally applying custom settings to override repository settings + + The script will prompt you interactively for authentication using device code flow. + For automated/unattended execution, you can configure AdminCenterApiCredentials as a GitHub secret + or in Azure KeyVault. See https://aka.ms/algosettings for more information about AdminCenterApiCredentials. + + This is an alternative to localDevEnv.ps1 for users who cannot run Docker containers locally. + + RECOMMENDED USAGE: + Instead of modifying this script directly (which will be overwritten during AL-Go updates), + create a custom script that calls this one with your preferred parameters. For example, + create a file named after yourself (e.g., 'john-devenv.ps1') that contains: + + # My personal cloud development environment script + $mySettings = '{"country":"us"}' + . .\.AL-Go\cloudDevEnv.ps1 -environmentName "john-sandbox" -reuseExistingEnvironment $true -customSettings $mySettings + + This approach allows you to: + - Maintain your personal preferences without losing them during updates + - Share your setup with team members + - Version control your custom development configurations + - Easily switch between different development scenarios + +.PARAMETER environmentName + The name of the cloud sandbox environment to create or reuse. + If not specified, the script will prompt for input with a default of "{username}-sandbox". + +.PARAMETER reuseExistingEnvironment + Boolean parameter indicating whether to reuse an existing environment with the same name. + If $true, the script will use the existing environment if it exists. + If $false, the script will recreate the environment (deleting the old one if it exists). + If not specified, the script will prompt the user to select the behavior. + +.PARAMETER fromVSCode + Switch parameter indicating the script is being run from Visual Studio Code. + When specified, the script will pause at the end waiting for user input before closing. + +.PARAMETER clean + Switch parameter to create a clean development environment without compiling and publishing apps. + Useful for setting up a fresh environment without deploying any applications. + +.PARAMETER customSettings + JSON string containing custom settings that override repository settings. + These settings have the highest precedence and can be used to override country, + or other configuration without modifying repository files. + +.EXAMPLE + .\cloudDevEnv.ps1 + Runs the script interactively, prompting for all required parameters. + +.EXAMPLE + .\cloudDevEnv.ps1 -environmentName "my-sandbox" -reuseExistingEnvironment $true + Creates or reuses a cloud sandbox named "my-sandbox". + +.EXAMPLE + .\cloudDevEnv.ps1 -clean + Creates a clean cloud development environment without compiling and publishing apps. + +.EXAMPLE + .\cloudDevEnv.ps1 -customSettings '{"country":"dk"}' + Creates a cloud development environment with custom settings for Denmark country. + +.EXAMPLE + # Programmatic setup with custom settings + $envName = "test-sandbox" + $settings = '{"country": "us"}' + + . ./cloudDevEnv.ps1 -environmentName $envName -reuseExistingEnvironment $true -customSettings $settings + + Creates or reuses a cloud development environment with custom country setting. + +.NOTES + - Authentication is handled interactively via device code flow (https://aka.ms/devicelogin) + - For unattended execution, configure AdminCenterApiCredentials secret (see link below) + - Does not require Docker to be installed + - Script automatically downloads required AL-Go helper modules and actions + - Modifies launch.json in VS Code workspace for Cloud Sandbox configuration + - Custom settings parameter allows runtime override of repository settings + - If NewBcContainer.ps1 override exists, cloud development may not be supported + +.LINK + https://aka.ms/algosettings - AL-Go Settings Documentation + https://github.com/microsoft/AL-Go/blob/main/Scenarios/CreateOnlineDevEnv2.md - Online Dev Environment Setup +#> + Param( [string] $environmentName = "", [bool] $reuseExistingEnvironment, [switch] $fromVSCode, - [switch] $clean + [switch] $clean, + [string] $customSettings = "" ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 @@ -51,12 +141,12 @@ Write-Host -ForegroundColor Yellow @' $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/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt -$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder -$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder -$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/AL-Go-Helper.ps1' -folder $tmpFolder -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null +$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt +$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder +$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder +$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/AL-Go-Helper.ps1' -folder $tmpFolder +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null Import-Module $GitHubHelperPath Import-Module $ReadSettingsModule @@ -103,7 +193,8 @@ CreateDevEnv ` -reuseExistingEnvironment:$reuseExistingEnvironment ` -baseFolder $baseFolder ` -project $project ` - -clean:$clean + -clean:$clean ` + -customSettings $customSettings } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/localDevEnv.ps1 b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/localDevEnv.ps1 index 925b12bafc..b54fad4b82 100644 --- a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/localDevEnv.ps1 +++ b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/localDevEnv.ps1 @@ -1,8 +1,106 @@ -# -# Script for creating local development environment -# Please do not modify this script as it will be auto-updated from the AL-Go Template -# Recommended approach is to use as is or add a script (freddyk-devenv.ps1), which calls this script with the user specific parameters -# +<# +.SYNOPSIS + Creates a local development environment for Business Central AL development using Docker containers. + +.DESCRIPTION + This script sets up a local development environment by: + - Creating a Business Central container using Docker + - Compiling and publishing all apps and test apps to the development scope + - Configuring launch.json for Visual Studio Code with Local Sandbox configuration + - Optionally applying custom settings to override repository settings + + The script requires Docker to be installed and configured to run Windows containers. + If Docker setup fails, users can alternatively run cloudDevEnv.ps1 for cloud-based development. + + RECOMMENDED USAGE: + Instead of modifying this script directly (which will be overwritten during AL-Go updates), + create a custom script that calls this one with your preferred parameters. For example, + create a file named after yourself (e.g., 'john-devenv.ps1') that contains: + + # My personal development environment script + $mySettings = '{"country":"us","artifact":"////nextminor"}' + . .\.AL-Go\localDevEnv.ps1 -containerName "mydevenv" -auth UserPassword -customSettings $mySettings + + This approach allows you to: + - Maintain your personal preferences without losing them during updates + - Share your setup with team members + - Version control your custom development configurations + - Easily switch between different development scenarios + +.PARAMETER containerName + The name of the Docker container to create. If not specified, the script will prompt for input. + Default prompts for "bcserver" if not provided. + +.PARAMETER auth + Authentication mechanism for the container. Valid values are "UserPassword" or "Windows". + If not specified, the script will prompt the user to select the authentication method. + +.PARAMETER credential + PSCredential object containing username and password for container authentication. + If not provided, the script will prompt for credentials based on the selected auth method. + +.PARAMETER licenseFileUrl + Local path or secure download URL to a Business Central license file. + For AppSource apps targeting BC versions prior to 22, a developer license with object ID permissions is required. + For PTEs, this is optional but can be useful for dependent app object IDs. + Set to "none" to skip license file input. + +.PARAMETER fromVSCode + Switch parameter indicating the script is being run from Visual Studio Code. + When specified, the script will pause at the end waiting for user input before closing. + +.PARAMETER accept_insiderEula + Switch parameter to automatically accept the insider EULA when using Business Central insider builds. + Required when working with insider artifacts. + +.PARAMETER clean + Switch parameter to create a clean development environment without compiling and publishing apps. + Useful for setting up a fresh container without deploying any applications. + +.PARAMETER customSettings + JSON string containing custom settings that override repository settings. + These settings have the highest precedence and can be used to override artifact URLs, + country settings, or other configuration without modifying repository files. + +.EXAMPLE + .\localDevEnv.ps1 + Runs the script interactively, prompting for all required parameters. + +.EXAMPLE + .\localDevEnv.ps1 -containerName "mydevenv" -auth "UserPassword" + Creates a container named "mydevenv" with username/password authentication, prompting for credentials and LicenseFile. + +.EXAMPLE + .\localDevEnv.ps1 -clean + Creates a clean development environment without compiling and publishing apps. + +.EXAMPLE + .\localDevEnv.ps1 -customSettings '{"country":"dk","artifact":"////nextminor"}' + Creates a development environment with custom settings for Denmark country and specific artifact. + +.EXAMPLE + # Programmatic setup with credentials and custom settings + $Username = "SUPER" + $Password = "" + $cred = New-Object System.Management.Automation.PSCredential ($Username, (ConvertTo-SecureString $Password -AsPlainText -Force)) + $containerName = "bcserver" + $settings = '{"artifact": "////nextminor"}' + + . ./localDevEnv.ps1 -containerName $containerName -auth UserPassword -credential $cred -accept_insiderEula -licenseFileUrl "none" -customSettings $settings + + Creates a development environment with predefined credentials, using next minor version artifact, accepting insider EULA, and no license file. + +.NOTES + - Requires Docker Desktop to be installed and running with Windows container support + - For AppSource apps, may require a developer license for BC versions prior to 22 + - Script automatically downloads required AL-Go helper modules and actions + - Modifies launch.json in VS Code workspace for Local Sandbox configuration + - Custom settings parameter allows runtime override of repository settings + +.LINK + https://aka.ms/algosettings - AL-Go Settings Documentation +#> + Param( [string] $containerName = "", [ValidateSet("UserPassword", "Windows")] @@ -11,7 +109,8 @@ Param( [string] $licenseFileUrl = "", [switch] $fromVSCode, [switch] $accept_insiderEula, - [switch] $clean + [switch] $clean, + [string] $customSettings = "" ) $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 @@ -55,12 +154,12 @@ Write-Host -ForegroundColor Yellow @' $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/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt -$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder -$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder -$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/AL-Go-Helper.ps1' -folder $tmpFolder -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null -DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null +$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Github-Helper.psm1' -folder $tmpFolder -notifyAuthenticatedAttempt +$ReadSettingsModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/ReadSettings.psm1' -folder $tmpFolder +$debugLoggingModule = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/DebugLogHelper.psm1' -folder $tmpFolder +$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/AL-Go-Helper.ps1' -folder $tmpFolder +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json' -folder $tmpFolder | Out-Null +DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/Environment.Packages.proj' -folder $tmpFolder | Out-Null Import-Module $GitHubHelperPath Import-Module $ReadSettingsModule @@ -160,7 +259,8 @@ CreateDevEnv ` -credential $credential ` -licenseFileUrl $licenseFileUrl ` -accept_insiderEula:$accept_insiderEula ` - -clean:$clean + -clean:$clean ` + -customSettings $customSettings } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json index a6f6b2bfd0..6e9cd1f971 100644 --- a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json +++ b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json @@ -1,7 +1,6 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/32e66d69cfd2c1e3eca39e416e27c6aa58de6df3/Actions/.Modules/settings.schema.json", + "$schema": "https://raw.githubusercontent.com/microsoft/AL-Go/0c7b1de38ba518aaf5fdee3902c2d2ae886ede32/Actions/.Modules/settings.schema.json", "projectName": "1st Party Apps Tests (W1)", - "testFolders": [ - ], + "testFolders": [], "doNotRunTests": false }