Skip to content

Commit

Permalink
[ODS-6568] Revert changes done to remove mono in Ubuntu 24 runners (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
axelmarquezh authored Dec 3, 2024
1 parent 59c9de1 commit e94f447
Show file tree
Hide file tree
Showing 22 changed files with 116 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/CodeQL Security Scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
$PSVersionTable
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1
Invoke-CodeGen -Engine PostgreSQL -RepositoryRoot $env:GITHUB_WORKSPACE/ -StandardVersion ${{ matrix.StandardVersion }} -ExtensionVersion ${{ matrix.ExtensionVersion }}
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.admin.dataaccess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.loadtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.ods.api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.ods.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.ods.standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS-Implementation"
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Lib edFi.security.dataaccess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/Pkg EdFi.Database.Admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ jobs:
nuget pack $AdminBACPACNuspecFilePath -OutputDirectory $packageOutput -Version $version -Properties "configuration=release" -Properties "authors=Ed-Fi Alliance" -Properties "owners=Ed-Fi Alliance" -Properties "copyright=Copyright © $(date +'%Y') Ed-Fi Alliance, LLC and Contributors" -NoPackageAnalysis -NoDefaultExcludes
nuget pack $AdminPostgreSQLNuspecFilePath -OutputDirectory $packageOutput -Version $version -Properties "configuration=release" -Properties "authors=Ed-Fi Alliance" -Properties "owners=Ed-Fi Alliance" -Properties "copyright=Copyright © $(date +'%Y') Ed-Fi Alliance, LLC and Contributors" -NoPackageAnalysis -NoDefaultExcludes
- name: Install-credential-handler
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 InstallCredentialHandler
shell: powershell
- name: Publish Nuget package
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
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.Database.Admin.Standard.${{ matrix.StandardVersion }}"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/Pkg EdFi.Database.Security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ jobs:
nuget pack $SecurityBACPACNuspecFilePath -OutputDirectory $packageOutput -Version $version -Properties "configuration=release" -Properties "authors=Ed-Fi Alliance" -Properties "owners=Ed-Fi Alliance" -Properties "copyright=Copyright © $(date +'%Y') Ed-Fi Alliance, LLC and Contributors" -NoPackageAnalysis -NoDefaultExcludes
nuget pack $SecurityPostgreSQLNuspecFilePath -OutputDirectory $packageOutput -Version $version -Properties "configuration=release" -Properties "authors=Ed-Fi Alliance" -Properties "owners=Ed-Fi Alliance" -Properties "copyright=Copyright © $(date +'%Y') Ed-Fi Alliance, LLC and Contributors" -NoPackageAnalysis -NoDefaultExcludes
- name: Install-credential-handler
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
working-directory: ./Ed-Fi-ODS/
run: |
.\build.githubactions.ps1 InstallCredentialHandler
shell: powershell
- name: Publish Nuget package
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
working-directory: ./Ed-Fi-ODS/
if: ${{ env.AZURE_ARTIFACT_NUGET_KEY != '' && github.event_name == 'workflow_dispatch' }}
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.Database.Security.Standard.${{ matrix.StandardVersion }}"
.\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.Database.Security.BACPAC.Standard.${{ matrix.StandardVersion }}"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Pkg EdFi.Ods.CodeGen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-Extensions"
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ jobs:
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get -y install postgresql-client-16
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ jobs:
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get -y install postgresql-client-16
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Pkg EdFi.Ods.Minimal.Template.TPDM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ jobs:
echo "BUILD_INCREMENTER=$newRevision">> $env:GITHUB_ENV
}
shell: pwsh
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Pkg EdFi.Ods.Minimal.Template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ jobs:
echo "BUILD_INCREMENTER=$newRevision">> $env:GITHUB_ENV
}
shell: pwsh
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ jobs:
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get -y install postgresql-client-16
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ jobs:
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get -y install postgresql-client-16
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Pkg EdFi.Ods.Populated.Template.TPDM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ jobs:
echo "BUILD_INCREMENTER=$newRevision">> $env:GITHUB_ENV
}
shell: pwsh
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Pkg EdFi.Ods.Populated.Template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ jobs:
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS-Implementation"
# This step shall be removed in ODS-6572
- name: Install Mono and Nuget
working-directory: ./Ed-Fi-ODS/.github/workflows
run: sudo ./install-mono.sh
- name: Cache Nuget packages
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 #v4.0.1
with:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/install-mono.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash -e

# 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.

# Sourced and adapted from:
# https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-mono.sh

# This script shall be removed in ODS-6572

REPO_URL="https://download.mono-project.com/repo/ubuntu"
GPG_KEY="/usr/share/keyrings/mono-official-stable.gpg"
REPO_PATH="/etc/apt/sources.list.d/mono-official-stable.list"

# There are no packages for Ubuntu 22 and 24 in the repo, but developers confirmed that packages from Ubuntu 20 should work
os_label="focal"

# Install Mono repo
curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL stable-$os_label main" > $REPO_PATH

# Install Mono
apt-get update
apt-get install --no-install-recommends apt-transport-https mono-complete nuget

# Remove Mono's apt repo
rm $REPO_PATH
rm -f "${REPO_PATH}.save"
rm $GPG_KEY

# Document source repo
echo "mono https://download.mono-project.com/repo/ubuntu stable-$os_label main" >> $HELPER_SCRIPTS/apt-sources.txt
4 changes: 2 additions & 2 deletions Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.OdsApi.Sdk.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<id>EdFi.OdsApi.Sdk</id>
<version>$version$</version>
<title>EdFi.OdsApi.Sdk</title>
<authors>Ed-Fi Alliance</authors>
<owners>Ed-Fi Alliance</owners>
<authors>$authors$</authors>
<owners>$owners$</owners>
<projectUrl>https://github.com/Ed-Fi-Alliance-OSS/Ed-Fi-ODS</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A pregenerated sdk for use with the Ed-Fi Ods Api.</description>
Expand Down
21 changes: 2 additions & 19 deletions build.githubactions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -161,24 +161,7 @@ function Pack {
$xml.package.metadata.id = $PackageName
$xml.package.metadata.description = $PackageName
$xml.Save($NuspecFilePath)

if (Get-IsWindows){
nuget pack $NuspecFilePath -OutputDirectory $packageOutput -Version $version -Properties configuration=$Configuration -Properties copyright=$Copyright -NoPackageAnalysis -NoDefaultExcludes
}
else{
$params = @{
PackageDefinitionFile = $NuspecFilePath
Version = $version
PackageId = $PackageName
OutputDirectory = $packageOutput
BuildConfiguration = $Configuration
ProjectFile = $ProjectFile
}

& "$PSScriptRoot/../Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1"

New-Package @params | Out-Host
}
nuget pack $NuspecFilePath -OutputDirectory $packageOutput -Version $version -Properties configuration=$Configuration -Properties copyright=$Copyright -NoPackageAnalysis -NoDefaultExcludes

}
if ([string]::IsNullOrWhiteSpace($NuspecFilePath) -and $null -ne $PackageName){
Expand Down Expand Up @@ -466,4 +449,4 @@ Invoke-Main {
TriggerImplementationRepositoryWorkflows { TriggerImplementationRepositoryWorkflows }
default { throw "Command '$Command' is not recognized" }
}
}
}

0 comments on commit e94f447

Please sign in to comment.