Skip to content

Commit

Permalink
Fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauxjpn committed Oct 8, 2023
1 parent c8b742f commit bd86ca2
Showing 1 changed file with 38 additions and 8 deletions.
46 changes: 38 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ on:
paths-ignore:
- '**.md'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
mysqlCurrentSqlMode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
mysqlLegacySqlMode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# Currently no ONLY_FULL_GROUP_BY, see #1167:
mariadbSqlMode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
maxConnections: 512
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
skipAllTests: false
skipAllTests: true
skipWindowsTests: false
jobs:
BuildAndTest:
Expand All @@ -40,7 +40,8 @@ jobs:
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- name: Set additional variables
shell: pwsh
run: |
Expand Down Expand Up @@ -88,6 +89,9 @@ jobs:
echo "clientExecutable: ${{ env.clientExecutable }}"
echo "clientCommandPrefix: ${{ env.clientCommandPrefix }}"
echo "windowsUserTempLocation: ${{ env.windowsUserTempLocation }}"
echo "github.event_name: ${{ github.event_name }}"
echo "github.repository: ${{ github.repository }}"
- name: Cache - Database Image - Linux
id: cache-databaseImage-linux
uses: actions/cache@v3
Expand Down Expand Up @@ -292,9 +296,11 @@ jobs:
dotnet test -c Release --no-build --logger "GitHubActions;report-warnings=false" test/EFCore.MySql.IntegrationTests
NuGet:
needs: BuildAndTest
if: github.event_name == 'push' && startsWith(github.repository, 'PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/')
if: github.event_name == 'push' && github.repository == 'PomeloFoundation/Pomelo.EntityFrameworkCore.MySql'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
Expand All @@ -312,7 +318,7 @@ jobs:
$ciBuildOnly = $wipBuild -or ('${{ github.ref }}' -match '^refs/heads/(?:master|release/.*)$')
$continuousIntegrationTimestamp = Get-Date -Format yyyyMMddHHmmss
$buildSha = '${{ github.sha }}'.SubString(0, 7);
$pack = '$(buildAndTestSucceeded)' -eq "true" -and ($officialBuild -or $ciBuildOnly -or $wipBuild)
$pack = $officialBuild -or $ciBuildOnly
$pushToAzureArtifacts = $pack
$pushToMygetOrg = $pack
Expand Down Expand Up @@ -389,12 +395,36 @@ jobs:
if: ${{ env.pushToAzureArtifacts == 'true' }}
working-directory: nupkgs
shell: pwsh
run: dotnet nuget push './Debug/withPdbs/**/*.nupkg' --api-key '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW }}' --source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.json'
run: |
# https://learn.microsoft.com/en-us/azure/devops/artifacts/nuget/dotnet-exe?view=azure-devops#publish-packages-from-external-sources
dotnet nuget nugetconfig --output './azdo-nuget' --force
try
{
dotnet nuget add source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.json' --name 'azdo-pomelo-efcore-debug' --username '${{ vars.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW_USERNAME }}' --password '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW_PASSWORD }}' --configfile './azdo-nuget/nuget.config'
dotnet nuget push './Release/withPdbs/**/*.nupkg' --configfile './azdo-nuget/nuget.config' --api-key 'foo' --source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.json'
}
finally
{
Remove-Item ./azdo-nuget -Recurse -Force
}
- name: "NuGet Push - AZDO Feed - Release"
if: ${{ env.pushToAzureArtifacts == 'true' }}
working-directory: nupkgs
shell: pwsh
run: dotnet nuget push './Release/withPdbs/**/*.nupkg' --api-key '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW }}' --source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json'
run: |
# https://learn.microsoft.com/en-us/azure/devops/artifacts/nuget/dotnet-exe?view=azure-devops#publish-packages-from-external-sources
dotnet nuget nugetconfig --output './azdo-nuget' --force
try
{
dotnet nuget add source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json' --name 'azdo-pomelo-efcore-public' --username '${{ vars.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW_USERNAME }}' --password '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW_PASSWORD }}' --configfile './azdo-nuget/nuget.config'
dotnet nuget push './Release/withPdbs/**/*.nupkg' --configfile './azdo-nuget/nuget.config' --api-key 'foo' --source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json'
}
finally
{
Remove-Item ./azdo-nuget -Recurse -Force
}
- name: "NuGet Push - myget.org - Debug"
if: ${{ env.pushToMygetOrg == 'true' }}
working-directory: nupkgs
Expand Down

0 comments on commit bd86ca2

Please sign in to comment.