diff --git a/Actions/CalculateArtifactNames/CalculateArtifactNames.ps1 b/Actions/CalculateArtifactNames/CalculateArtifactNames.ps1 index 8b82d9e5d..58b189abc 100644 --- a/Actions/CalculateArtifactNames/CalculateArtifactNames.ps1 +++ b/Actions/CalculateArtifactNames/CalculateArtifactNames.ps1 @@ -49,7 +49,7 @@ else { } # Set this build artifacts name -'Apps', 'TestApps' | ForEach-Object { +'Apps', 'Dependencies', 'TestApps' | ForEach-Object { $name = "ThisBuild$($_)ArtifactsName" $value = "thisbuild-$($projectName)-$($buildMode)$($_)" Set-OutputVariable -name $name -value $value diff --git a/Actions/CalculateArtifactNames/README.md b/Actions/CalculateArtifactNames/README.md index 050d6e990..eabbdd4c6 100644 --- a/Actions/CalculateArtifactNames/README.md +++ b/Actions/CalculateArtifactNames/README.md @@ -22,6 +22,7 @@ Calculate Artifact Names for AL-Go workflows | Name | Description | | :-- | :-- | | ThisBuildAppsArtifactsName | Artifact name for apps being built in the current workflow run | +| ThisBuildDependenciesArtifactsName | Artifact name for dependencies of apps being built in the current workflow run | | ThisBuildTestAppsArtifactsName | Artifact name for test apps being built in the current workflow run | | AppsArtifactsName | Artifacts name for Apps | | DependenciesArtifactsName | Artifacts name for Dependencies | @@ -36,6 +37,7 @@ Calculate Artifact Names for AL-Go workflows | Name | Description | | :-- | :-- | | ThisBuildAppsArtifactsName | Artifact name for apps being built in the current workflow run | +| ThisBuildDependenciesArtifactsName | Artifact name for dependencies of apps being built in the current workflow run | | ThisBuildTestAppsArtifactsName | Artifact name for test apps being built in the current workflow run | | AppsArtifactsName | Artifacts name for Apps | | DependenciesArtifactsName | Artifacts name for Dependencies | diff --git a/Actions/CalculateArtifactNames/action.yaml b/Actions/CalculateArtifactNames/action.yaml index dc9c49bab..2f17dfc82 100644 --- a/Actions/CalculateArtifactNames/action.yaml +++ b/Actions/CalculateArtifactNames/action.yaml @@ -19,6 +19,9 @@ outputs: ThisBuildAppsArtifactsName: description: Artifact name for apps being built in the current workflow run value: ${{ steps.calculateartifactnames.outputs.ThisBuildAppsArtifactsName }} + ThisBuildDependenciesArtifactsName: + description: Artifact name for dependencies of apps being built in the current workflow run + value: ${{ steps.calculateartifactnames.outputs.ThisBuildDependenciesArtifactsName }} ThisBuildTestAppsArtifactsName: description: Artifact name for test apps being built in the current workflow run value: ${{ steps.calculateartifactnames.outputs.ThisBuildTestAppsArtifactsName }} diff --git a/Actions/Github-Helper.psm1 b/Actions/Github-Helper.psm1 index 0a10f8fbf..20d567bfc 100644 --- a/Actions/Github-Helper.psm1 +++ b/Actions/Github-Helper.psm1 @@ -131,7 +131,7 @@ function GetDependencies { } $downloadedList = @() - foreach($mask in 'Apps','TestApps') { + foreach($mask in 'Apps','Dependencies','TestApps') { foreach($dependency in $probingPathsJson) { $projects = $dependency.projects $buildMode = $dependency.buildMode diff --git a/Actions/RunPipeline/RunPipeline.ps1 b/Actions/RunPipeline/RunPipeline.ps1 index 74960e66c..efae54ab3 100644 --- a/Actions/RunPipeline/RunPipeline.ps1 +++ b/Actions/RunPipeline/RunPipeline.ps1 @@ -385,7 +385,7 @@ try { -installApps $installApps ` -installTestApps $installTestApps ` -installOnlyReferencedApps:$settings.installOnlyReferencedApps ` - -generateDependencyArtifact:$settings.generateDependencyArtifact ` + -generateDependencyArtifact ` -updateDependencies:$settings.updateDependencies ` -previousApps $previousApps ` -appFolders $settings.appFolders ` diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 077e59f38..0e2dee476 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -4,6 +4,7 @@ Note that when using the preview version of AL-Go for GitHub, we recommend you U ### Issues - Issue 782 Exclude '.altestrunner/' from template .gitignore +- Issue 823 Dependencies from prior build jobs are not included when using useProjectDependencies - App artifacts for version 'latest' are now fetched from the latest CICD run that completed and successfully built all the projects for the corresponding branch. ## v4.0 diff --git a/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml b/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml index da153af1f..604ed437c 100644 --- a/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml +++ b/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml @@ -91,7 +91,7 @@ jobs: with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} - get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact + get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact,generateDependencyArtifact - name: Read secrets id: ReadSecrets @@ -172,6 +172,15 @@ jobs: if-no-files-found: ignore retention-days: 1 + - name: Upload thisbuild artifacts - dependencies + if: inputs.publishThisBuildArtifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildDependenciesArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/Dependencies/' + if-no-files-found: ignore + retention-days: 1 + - name: Upload thisbuild artifacts - test apps if: inputs.publishThisBuildArtifacts uses: actions/upload-artifact@v3 @@ -191,7 +200,7 @@ jobs: - name: Publish artifacts - dependencies uses: actions/upload-artifact@v3 - if: inputs.publishArtifacts + if: inputs.publishArtifacts && env.generateDependencyArtifact == 'True' with: name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/Dependencies/' diff --git a/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml b/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml index da153af1f..604ed437c 100644 --- a/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml @@ -91,7 +91,7 @@ jobs: with: shell: ${{ inputs.shell }} project: ${{ inputs.project }} - get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact + get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact,generateDependencyArtifact - name: Read secrets id: ReadSecrets @@ -172,6 +172,15 @@ jobs: if-no-files-found: ignore retention-days: 1 + - name: Upload thisbuild artifacts - dependencies + if: inputs.publishThisBuildArtifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildDependenciesArtifactsName }} + path: '${{ inputs.project }}/.buildartifacts/Dependencies/' + if-no-files-found: ignore + retention-days: 1 + - name: Upload thisbuild artifacts - test apps if: inputs.publishThisBuildArtifacts uses: actions/upload-artifact@v3 @@ -191,7 +200,7 @@ jobs: - name: Publish artifacts - dependencies uses: actions/upload-artifact@v3 - if: inputs.publishArtifacts + if: inputs.publishArtifacts && env.generateDependencyArtifact == 'True' with: name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }} path: '${{ inputs.project }}/.buildartifacts/Dependencies/' diff --git a/Tests/CalculateArtifactNames.Test.ps1 b/Tests/CalculateArtifactNames.Test.ps1 index 95376866b..231af0740 100644 --- a/Tests/CalculateArtifactNames.Test.ps1 +++ b/Tests/CalculateArtifactNames.Test.ps1 @@ -145,6 +145,7 @@ Describe 'CalculateArtifactNames Action Tests' { } $outputs = [ordered]@{ "ThisBuildAppsArtifactsName" = "Artifact name for apps being built in the current workflow run" + "ThisBuildDependenciesArtifactsName" = "Artifact name for dependencies of apps being built in the current workflow run" "ThisBuildTestAppsArtifactsName" = "Artifact name for test apps being built in the current workflow run" "AppsArtifactsName" = "Artifacts name for Apps" "DependenciesArtifactsName" = "Artifacts name for Dependencies"