From b2dd0083e01f4e8d75bf1222381ec5910707c31e Mon Sep 17 00:00:00 2001 From: Alexander Holstrup <117829001+aholstrup1@users.noreply.github.com> Date: Tue, 16 May 2023 14:25:44 +0200 Subject: [PATCH 1/2] Rename release branch (#13) --- .github/AL-Go-Settings.json | 4 ++-- .github/workflows/CICD.yaml | 2 +- .github/workflows/CreateBuildTag.yaml | 2 +- .github/workflows/PublishNuget.yaml | 2 +- .github/workflows/PullRequestHandler.yaml | 2 +- .github/workflows/UpdatePackageVersions.yaml | 2 +- Build/Scripts/UpdatePackageVersions.ps1 | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index 121b1927d3..fab6de7257 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -36,11 +36,11 @@ "enableCodeCop": true, "CICDPushBranches": [ "main", - "releases/*" + "release/*" ], "CICDPullRequestBranches": [ "main", - "releases/*" + "release/*" ], "rulesetFile": "..\\..\\Build\\Rulesets\\module.ruleset.json" } diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index 8994fd3998..3d644eaa2b 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -7,7 +7,7 @@ on: - '**.md' - '.github/workflows/*.yaml' - '!.github/workflows/CICD.yaml' - branches: [ 'main', 'releases/*' ] + branches: [ 'main', 'release/*' ] defaults: run: diff --git a/.github/workflows/CreateBuildTag.yaml b/.github/workflows/CreateBuildTag.yaml index 76660c80ca..8f538d89ee 100644 --- a/.github/workflows/CreateBuildTag.yaml +++ b/.github/workflows/CreateBuildTag.yaml @@ -4,7 +4,7 @@ on: workflow_run: workflows: [' CI/CD'] types: ['completed'] - branches: ['main', 'releases/*'] + branches: ['main', 'release/*'] run-name: Create build tag on branch ${{ github.ref_name }}. diff --git a/.github/workflows/PublishNuget.yaml b/.github/workflows/PublishNuget.yaml index 7c8c8eede0..b5f1e790f6 100644 --- a/.github/workflows/PublishNuget.yaml +++ b/.github/workflows/PublishNuget.yaml @@ -4,7 +4,7 @@ on: workflow_run: workflows: [' CI/CD'] types: [completed] - branches: ['main', 'releases/*'] + branches: ['main', 'release/*'] permissions: read-all diff --git a/.github/workflows/PullRequestHandler.yaml b/.github/workflows/PullRequestHandler.yaml index 6a5b639bae..daa6521d52 100644 --- a/.github/workflows/PullRequestHandler.yaml +++ b/.github/workflows/PullRequestHandler.yaml @@ -4,7 +4,7 @@ on: pull_request_target: paths-ignore: - '**.md' - branches: [ 'main', 'releases/*' ] + branches: [ 'main', 'release/*' ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} diff --git a/.github/workflows/UpdatePackageVersions.yaml b/.github/workflows/UpdatePackageVersions.yaml index bb89d2c2ef..d5cfa3303b 100644 --- a/.github/workflows/UpdatePackageVersions.yaml +++ b/.github/workflows/UpdatePackageVersions.yaml @@ -22,7 +22,7 @@ jobs: id: GetBranches run: | git fetch - $branches = @(git for-each-ref --format="'%(refname:short)'" refs/remotes/origin/releases/ | % { $_ -replace 'origin/', '' }) + $branches = @(git for-each-ref --format="'%(refname:short)'" refs/remotes/origin/release/ | % { $_ -replace 'origin/', '' }) $branches += "'main'" $branchMatrix = "[$($branches -join ',')]" diff --git a/Build/Scripts/UpdatePackageVersions.ps1 b/Build/Scripts/UpdatePackageVersions.ps1 index fffb5d3072..e0c87e55b4 100644 --- a/Build/Scripts/UpdatePackageVersions.ps1 +++ b/Build/Scripts/UpdatePackageVersions.ps1 @@ -41,7 +41,7 @@ if ($updatesAvailable) { # Create branch and push changes Set-GitConfig -Actor $Actor $BranchName = New-TopicBranch -Category "UpdatePackageVersions" - $title = "Update package versions" + $title = "[$TargetBranch] Update package versions" Push-GitBranch -BranchName $BranchName -Files @("Build/Packages.json") -CommitMessage $title # Create PR From 99c143bca530c9c2ba960d49cdf9828c57b56426 Mon Sep 17 00:00:00 2001 From: Alexander Holstrup <117829001+aholstrup1@users.noreply.github.com> Date: Tue, 16 May 2023 15:06:14 +0200 Subject: [PATCH 2/2] Add missing build script (#15) --- .github/AL-Go-Settings.json | 3 ++- CODEOWNERS | 7 +++++++ build.ps1 | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 CODEOWNERS create mode 100644 build.ps1 diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index fab6de7257..590b71ac26 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -42,5 +42,6 @@ "main", "release/*" ], - "rulesetFile": "..\\..\\Build\\Rulesets\\module.ruleset.json" + "rulesetFile": "..\\..\\Build\\Rulesets\\module.ruleset.json", + "skipUpgrade": true } diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000..88c27a9484 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,7 @@ +# AL-Go files and build scripts are owned by Engineering Systems +.AL-Go/ @microsoft/dynamics-smb-engineering-systems +*.ps1 @microsoft/dynamics-smb-engineering-systems +/.azuredevops @microsoft/dynamics-smb-engineering-systems +/.github @microsoft/dynamics-smb-engineering-systems +/Build @microsoft/dynamics-smb-engineering-systems +/CODEOWNERS @microsoft/dynamics-smb-engineering-systems diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000000..c28435ab4a --- /dev/null +++ b/build.ps1 @@ -0,0 +1,34 @@ +<# + .Synopsis + Build script for AL-Go projects + .Description + This script will run localDevEnv.ps1 in the specified AL-Go project + .Parameter ALGoProject + The name of the AL-Go project + .Parameter InsiderSasToken + The SAS token to use for downloading insider builds + .Parameter AutoFill + If specified, the script will generate a random password and use that for the credential + .Example + .\build.ps1 -ALGoProject "System Application" + .\build.ps1 -ALGoProject "Test Stability Tools" -AutoFill +#> +param +( + [Parameter(Mandatory=$true)] + [string] $ALGoProject, + [string] $InsiderSasToken = "", + [switch] $AutoFill +) + +if ($AutoFill) { + Add-Type -AssemblyName System.Web + + $credential = New-Object pscredential admin, (ConvertTo-SecureString -String ([System.Web.Security.Membership]::GeneratePassword(20, 5)) -AsPlainText -Force) + $licenseFileUrl = 'none' + $containerName = "bcserver" + $auth = "UserPassword" +} + +$scriptPath = Join-Path $PSScriptRoot "$ALGoProject\.AL-Go\localDevEnv.ps1" -Resolve +& $scriptPath -containerName $containerName -auth $auth -credential $credential -licenseFileUrl $licenseFileUrl -insiderSasToken $InsiderSasToken