[ODS-6570] Nhibernate Upgrade for 7.1 and 7.2 (#1190) #1275
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Apache-2.0 | |
# Licensed to the Ed-Fi Alliance under one or more agreements. | |
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. | |
# See the LICENSE and NOTICES files in the project root for more information. | |
name: Pkg EdFi.Ods.Populated.Template | |
on: | |
push: | |
branches: | |
[main, 'ODS-*',b-v*-patch*] | |
workflow_dispatch: | |
inputs: | |
distinct_id: | |
description: 'distinct ID for Rebuild Database Templates workflow' | |
required: false | |
default: 'distinct_id' | |
env: | |
INFORMATIONAL_VERSION: "7.1" | |
BUILD_INCREMENTER: "-276" | |
AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json" | |
AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }} | |
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}' | |
CONFIGURATION: "Release" | |
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }} | |
HEAD_REF: ${{ GITHUB.HEAD_REF }} | |
REF_NAME: ${{ GITHUB.REF_NAME }} | |
REPOSITORY_OWNER: ${{ GITHUB.REPOSITORY_OWNER }} | |
jobs: | |
FindStandardVersions: | |
runs-on: ubuntu-latest | |
outputs: | |
StandardVersions: ${{ steps.Set_StandardVersions.outputs.StandardVersions }} | |
steps: | |
- name: Checkout Ed-Fi-ODS | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS | |
path: Ed-Fi-ODS/ | |
- name: Set StandardVersions | |
id: Set_StandardVersions | |
working-directory: ./Ed-Fi-ODS/ | |
run: | | |
$output = .\build.githubactions.ps1 StandardVersions -ProjectFile "$env:GITHUB_WORKSPACE/Ed-Fi-ODS/Application/EdFi.Ods.Standard/EdFi.Ods.Standard.csproj" | |
echo "StandardVersions=$output" >> $env:GITHUB_OUTPUT | |
Write-host "StandardVersions is $output" | |
shell: pwsh | |
build: | |
if: ${{ always() }} | |
needs: FindStandardVersions | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
StandardVersion: ${{ fromJson(needs.FindStandardVersions.outputs.StandardVersions) }} | |
name: build (Standard Version ${{ matrix.StandardVersion }}) | |
steps: | |
- name: echo distinct ID ${{ github.event.inputs.distinct_id }} | |
run: echo "${{ github.event.inputs.distinct_id }}" | |
- name: Check for Azure token | |
if: ${{ env.REPOSITORY_OWNER == 'Ed-Fi-Alliance-OSS' && env.AZURE_ARTIFACT_NUGET_KEY == '' }} | |
run: | | |
echo "::error::Missing Azure Token" | |
exit 1 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # 2.1.0 | |
with: | |
dotnet-version: 6.0.x | |
- name: Support longpaths | |
run: git config --system core.longpaths true | |
- name: Checkout Ed-Fi-ODS | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS | |
path: Ed-Fi-ODS/ | |
- name: Checkout Ed-Fi-ODS-Implementation | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation | |
path: Ed-Fi-ODS-Implementation/ | |
- name: Set Ed-Fi-Standard Reference | |
working-directory: ./Ed-Fi-ODS/ | |
run: | | |
$standardTag = .\build.githubactions.ps1 StandardTag -standardVersion ${{ matrix.StandardVersion }} -ProjectFile "./Application/EdFi.Ods.Standard/EdFi.Ods.Standard.csproj" | |
echo "EDFI_STANDARD_REFERENCE=$standardTag">> $env:GITHUB_ENV | |
Write-host "Ed-Fi-Standard Tag is $standardTag" | |
shell: powershell | |
- name: Checkout Ed-Fi-ODS-Standard | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
with: | |
repository: Ed-Fi-Alliance-OSS/Ed-Fi-Standard | |
path: Ed-Fi-Standard/ | |
ref: ${{ env.EDFI_STANDARD_REFERENCE }} | |
- name: Is pull request branch exists in Ed-Fi-ODS-Implementation | |
working-directory: ./Ed-Fi-ODS/ | |
shell: powershell | |
run: | | |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS-Implementation" | |
- name: Install sql-server-2019 & sqlpackage | |
shell: powershell | |
run: | | |
choco install sql-server-2019 -y --params "'/IGNOREPENDINGREBOOT /IACCEPTSQLSERVERLICENSETERMS /Q /ACTION=install /INSTANCEID=MSSQLSERVER /INSTANCENAME=MSSQLSERVER /TCPENABLED=1 /UPDATEENABLED=FALSE /FEATURES=SQL,Tools'" --execution-timeout=$installTimeout | |
choco install sqlpackage | |
- name: Cache Nuget packages | |
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*', '**/configuration.packages.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Restore NuGet packages | |
working-directory: ./Ed-Fi-ODS/ | |
run: | | |
.\build.githubactions.ps1 restore -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Application/Ed-Fi-Ods.sln" | |
shell: powershell | |
- name: Initialize-DevelopmentEnvironment | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
[Environment]::SetEnvironmentVariable('msbuild_buildConfiguration', '${{ env.CONFIGURATION }}') | |
$PSVersionTable | |
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1 | |
Initialize-DevelopmentEnvironment -NoDeploy -NoRestore -StandardVersion ${{ matrix.StandardVersion }} | |
shell: powershell | |
- name: Remove Plug-Ins | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
rm -R "./Plugin/Extensions.*" | |
shell: powershell | |
- name: Create Database Template (no extensions) | |
working-directory: ./ | |
run: | | |
$ErrorActionPreference = 'Stop' | |
[Environment]::SetEnvironmentVariable('msbuild_buildConfiguration', '${{ env.CONFIGURATION }}') | |
Import-Module -Force -Scope Global "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/DatabaseTemplate/Modules/create-populated-template.psm1" | |
Initialize-PopulatedTemplate -samplePath './Ed-Fi-Standard/' -noExtensions -standardVersion ${{ matrix.StandardVersion }} | |
shell: powershell | |
- name: pack | |
working-directory: ./Ed-Fi-ODS/ | |
run: | | |
.\build.githubactions.ps1 pack -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuspecFilePath "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/DatabaseTemplate/Database/EdFi.Ods.Populated.Template.Standard.${{ matrix.StandardVersion }}.nuspec" -PackageName "EdFi.Suite3.Ods.Populated.Template.Standard.${{ matrix.StandardVersion }}" | |
shell: powershell | |
- name: Install-credential-handler | |
working-directory: ./Ed-Fi-ODS-Implementation/ | |
run: | | |
Import-Module -Force -Scope Global "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/logistics/scripts/modules/utility/cross-platform.psm1" | |
if (Get-IsWindows -and -not Get-InstalledModule | Where-Object -Property Name -eq "7Zip4Powershell") { | |
Install-Module -Force -Scope CurrentUser -Name 7Zip4Powershell | |
} | |
# using WebClient is faster then Invoke-WebRequest but shows no progress | |
$sourceUrl = ' https://github.com/microsoft/artifacts-credprovider/releases/download/v1.0.0/Microsoft.NuGet.CredentialProvider.zip' | |
$fileName = 'Microsoft.NuGet.CredentialProvider.zip' | |
Write-host "Downloading file from $sourceUrl..." | |
$webClient = New-Object System.Net.WebClient | |
$webClient.DownloadFile($sourceUrl, "$env:temp/$fileName") | |
Write-host "Download complete." | |
if (-not (Test-Path "$env:temp/$fileName")) { | |
Write-Warning "Microsoft.NuGet.CredentialProvider file '$fileName' not found." | |
exit 0 | |
} | |
$packageFolder = "$env:temp/Microsoft.NuGet.CredentialProvider/" | |
if ($fileName.EndsWith('.zip')) { | |
Write-host "Extracting $fileName..." | |
$zipFilePath = "$env:temp/$fileName" | |
if (Test-Path $zipFilePath) { Expand-Archive -Force -Path $zipFilePath -DestinationPath $packageFolder } | |
Copy-Item -Path $packageFolder\* -Destination "$env:UserProfile/.nuget/" -Recurse -Force | |
Write-Host "Extracted to: $env:UserProfile\.nuget\plugins\" -ForegroundColor Green | |
} | |
shell: powershell | |
- name: publish | |
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' }} | |
working-directory: ./Ed-Fi-ODS/ | |
run: | | |
.\build.githubactions.ps1 publish -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuGetApiKey ${{ env.AZURE_ARTIFACT_NUGET_KEY }} -EdFiNuGetFeed ${{env.AZURE_ARTIFACT_URL}} -PackageName "EdFi.Suite3.Ods.Populated.Template.Standard.${{ matrix.StandardVersion }}" | |
shell: powershell | |
- name: Upload EdFi.Ods.Populated.Template Artifacts | |
if: success() || failure() | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 | |
with: | |
name: NugetPackages.Artifacts | |
path: ${{ github.workspace }}/Ed-Fi-ODS/NugetPackages/EdFi.Suite3.Ods.Populated.Template.*.nupkg | |
- name: Move Log Files | |
run: | | |
$bulkLoadClientSourcePath = "${{ github.workspace }}/Ed-Fi-ODS/Utilities/DataLoading/EdFi.BulkLoadClient.Console/bin/${{ env.CONFIGURATION }}/net6.0/logfile.txt" | |
$testHarnessSourcePath = "${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/${{ env.CONFIGURATION }}/net6.0/TestHarnessLog.log" | |
$testHarnessRequestResponseDetailsSourcePath = "${{ github.workspace }}/Ed-Fi-ODS-Implementation/Application/EdFi.Ods.Api.IntegrationTestHarness/bin/${{ env.CONFIGURATION }}/net6.0/TestHarnessRequestResponseDetailsLog.log" | |
$destinationPath = "${{ github.workspace }}/CreateDatabaseTemplateLogs/" | |
# Create the destination folder if it doesn't exist | |
if (!(Test-Path -Path $destinationPath)) { | |
New-Item -ItemType Directory -Path $destinationPath -Force | |
} | |
# Move the files | |
Move-Item -Path $bulkLoadClientSourcePath -Destination $destinationPath -Force | |
Move-Item -Path $testHarnessSourcePath -Destination $destinationPath -Force | |
Move-Item -Path $testHarnessRequestResponseDetailsSourcePath -Destination $destinationPath -Force | |
shell: pwsh | |
- name: Upload Create Database Template Logs | |
if: success() || failure() | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 | |
with: | |
name: Create Database Template Logs | |
path: | | |
${{ github.workspace }}/CreateDatabaseTemplateLogs/*.* | |