Skip to content

Commit

Permalink
Update AL-Go System Files
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Nov 4, 2023
1 parent 881f3b9 commit 528884e
Show file tree
Hide file tree
Showing 18 changed files with 364 additions and 491 deletions.
4 changes: 2 additions & 2 deletions .AL-Go/cloudDevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Write-Host -ForegroundColor Yellow @'
$webClient = New-Object System.Net.WebClient
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
$webClient.Encoding = [System.Text.Encoding]::UTF8
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/CheckForUpdates/Actions/Github-Helper.psm1'
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/Github-Helper.psm1'
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/CheckForUpdates/Actions/AL-Go-Helper.ps1'
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1'
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)
Expand Down
4 changes: 2 additions & 2 deletions .AL-Go/localDevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Write-Host -ForegroundColor Yellow @'
$webClient = New-Object System.Net.WebClient
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
$webClient.Encoding = [System.Text.Encoding]::UTF8
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/CheckForUpdates/Actions/Github-Helper.psm1'
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/Github-Helper.psm1'
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/CheckForUpdates/Actions/AL-Go-Helper.ps1'
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1'
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)
Expand Down
4 changes: 2 additions & 2 deletions .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "PTE",
"templateUrl": "https://github.com/freddydk/AL-Go@CheckForUpdates",
"templateUrl": "https://github.com/freddydk/AL-Go@nuget",
"DoNotUseCdnForArtifacts": true,
"useCompilerFolder": true,
"doNotPublishApps": true,
Expand Down Expand Up @@ -28,5 +28,5 @@
"ContinuousDeployment": true,
"runs-on": "ubuntu-latest"
},
"templateSha": "487e390e76603dddeef98fd023478e3970940f1b"
"templateSha": "03c67109fd663a21d274bad4c798bfb104002214"
}
31 changes: 9 additions & 22 deletions .github/workflows/AddExistingAppOrTestApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ on:
description: Direct Download Url of .app or .zip file
required: true
directCommit:
description: Direct Commit?
type: boolean
default: false
description: Direct COMMIT (Y/N)
required: false
default: 'N'
useGhTokenWorkflow:
description: Use GhTokenWorkflow for PR/Commit?
description: Use GhTokenWorkflow for Pull Request/COMMIT
type: boolean
default: false

permissions:
contents: write
Expand All @@ -35,46 +34,34 @@ env:

jobs:
AddExistingAppOrTestApp:
needs: [ ]
runs-on: [ ubuntu-latest ]
steps:
- name: Input
if: github.event_name == 'workflow_dispatch'
run: |
Write-Host "Inputs:"
$eventPath = Get-Content -Encoding UTF8 -Path $env:GITHUB_EVENT_PATH -Raw | ConvertFrom-Json
$eventPath.inputs.psObject.Properties | Sort-Object { $_.Name } | ForEach-Object {
$property = $_.Name
$value = $eventPath.inputs."$property"
Write-Host "- $property = '$value'"
}
- name: Checkout
uses: actions/checkout@v3

- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@CheckForUpdates
uses: freddydk/AL-Go/Actions/WorkflowInitialize@nuget
with:
shell: pwsh
eventId: "DO0090"

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: 'TokenForPush'
useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}'

- name: Add existing app
uses: freddydk/AL-Go/Actions/AddExistingApp@CheckForUpdates
uses: freddydk/AL-Go/Actions/AddExistingApp@nuget
with:
shell: pwsh
token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
Expand All @@ -85,7 +72,7 @@ jobs:

- name: Finalize the workflow
if: always()
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@CheckForUpdates
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@nuget
with:
shell: pwsh
eventId: "DO0090"
Expand Down
41 changes: 20 additions & 21 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ env:

jobs:
Initialization:
needs: [ ]
runs-on: [ ubuntu-latest ]
outputs:
telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
Expand All @@ -46,14 +45,14 @@ jobs:

- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@CheckForUpdates
uses: freddydk/AL-Go/Actions/WorkflowInitialize@nuget
with:
shell: pwsh
eventId: "DO0091"

- name: Read settings
id: ReadSettings
uses: freddydk/AL-Go/Actions/ReadSettings@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh
get: type
Expand All @@ -65,30 +64,30 @@ jobs:
- name: Determine Projects To Build
id: determineProjectsToBuild
uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@CheckForUpdates
uses: freddydk/AL-Go/Actions/DetermineProjectsToBuild@nuget
with:
shell: pwsh
maxBuildDepth: ${{ env.workflowDepth }}

- name: Determine Delivery Target Secrets
id: DetermineDeliveryTargetSecrets
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@CheckForUpdates
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@nuget
with:
shell: pwsh
projectsJson: '${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}'
checkContextSecrets: 'false'
checkContextSecrets: 'N'

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: ${{ steps.DetermineDeliveryTargetSecrets.outputs.ContextSecrets }}

- name: Determine Delivery Targets
id: DetermineDeliveryTargets
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@CheckForUpdates
uses: freddydk/AL-Go/Actions/DetermineDeliveryTargets@nuget
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand All @@ -98,7 +97,7 @@ jobs:

- name: Determine Deployment Environments
id: DetermineDeploymentEnvironments
uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@CheckForUpdates
uses: freddydk/AL-Go/Actions/DetermineDeploymentEnvironments@nuget
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand All @@ -107,24 +106,24 @@ jobs:
type: 'CD'

CheckForUpdates:
needs: [ Initialization ]
runs-on: [ ubuntu-latest ]
needs: [ Initialization ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh
get: templateUrl

- name: Check for updates to AL-Go system files
uses: freddydk/AL-Go/Actions/CheckForUpdates@CheckForUpdates
uses: freddydk/AL-Go/Actions/CheckForUpdates@nuget
with:
shell: pwsh
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
templateUrl: ${{ env.templateUrl }}
downloadLatest: true

Build:
needs: [ Initialization ]
Expand Down Expand Up @@ -169,7 +168,7 @@ jobs:
path: '.artifacts'

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

Expand All @@ -182,15 +181,15 @@ jobs:
- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: '${{ steps.envName.outputs.envName }}-AuthContext,${{ steps.envName.outputs.envName }}_AuthContext,AuthContext,${{ steps.envName.outputs.envName }}-EnvironmentName,${{ steps.envName.outputs.envName }}_EnvironmentName,EnvironmentName,projects'

- name: Deploy
id: Deploy
uses: freddydk/AL-Go/Actions/Deploy@CheckForUpdates
uses: freddydk/AL-Go/Actions/Deploy@nuget
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand Down Expand Up @@ -219,20 +218,20 @@ jobs:
path: '.artifacts'

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: '${{ matrix.deliveryTarget }}Context'

- name: Deliver
uses: freddydk/AL-Go/Actions/Deliver@CheckForUpdates
uses: freddydk/AL-Go/Actions/Deliver@nuget
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
Expand All @@ -243,16 +242,16 @@ jobs:
artifacts: '.artifacts'

PostProcess:
needs: [ Initialization, Build, Deploy, Deliver ]
if: (!cancelled())
runs-on: [ ubuntu-latest ]
needs: [ Initialization, Build, Deploy, Deliver ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Finalize the workflow
id: PostProcess
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@CheckForUpdates
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@nuget
with:
shell: pwsh
eventId: "DO0091"
Expand Down
37 changes: 12 additions & 25 deletions .github/workflows/CreateApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ on:
description: ID range (from..to)
required: true
sampleCode:
description: Include Sample code?
type: boolean
default: true
description: Include Sample code (Y/N)
required: false
default: 'Y'
directCommit:
description: Direct Commit?
type: boolean
default: false
description: Direct COMMIT (Y/N)
required: false
default: "N"
useGhTokenWorkflow:
description: Use GhTokenWorkflow for PR/Commit?
description: Use GhTokenWorkflow for Pull Request/COMMIT
type: boolean
default: false

permissions:
contents: write
Expand All @@ -45,47 +44,35 @@ env:

jobs:
CreateApp:
needs: [ ]
runs-on: [ ubuntu-latest ]
steps:
- name: Input
if: github.event_name == 'workflow_dispatch'
run: |
Write-Host "Inputs:"
$eventPath = Get-Content -Encoding UTF8 -Path $env:GITHUB_EVENT_PATH -Raw | ConvertFrom-Json
$eventPath.inputs.psObject.Properties | Sort-Object { $_.Name } | ForEach-Object {
$property = $_.Name
$value = $eventPath.inputs."$property"
Write-Host "- $property = '$value'"
}
- name: Checkout
uses: actions/checkout@v3

- name: Initialize the workflow
id: init
uses: freddydk/AL-Go/Actions/WorkflowInitialize@CheckForUpdates
uses: freddydk/AL-Go/Actions/WorkflowInitialize@nuget
with:
shell: pwsh
eventId: "DO0092"

- name: Read settings
uses: freddydk/AL-Go/Actions/ReadSettings@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSettings@nuget
with:
shell: pwsh
get: type

- name: Read secrets
id: ReadSecrets
uses: freddydk/AL-Go/Actions/ReadSecrets@CheckForUpdates
uses: freddydk/AL-Go/Actions/ReadSecrets@nuget
with:
shell: pwsh
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: 'TokenForPush'
useGhTokenWorkflowForPush: '${{ github.event.inputs.useGhTokenWorkflow }}'

- name: Creating a new app
uses: freddydk/AL-Go/Actions/CreateApp@CheckForUpdates
uses: freddydk/AL-Go/Actions/CreateApp@nuget
with:
shell: pwsh
token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
Expand All @@ -100,7 +87,7 @@ jobs:

- name: Finalize the workflow
if: always()
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@CheckForUpdates
uses: freddydk/AL-Go/Actions/WorkflowPostProcess@nuget
with:
shell: pwsh
eventId: "DO0092"
Expand Down
Loading

0 comments on commit 528884e

Please sign in to comment.