Skip to content

Commit

Permalink
Simplify CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauxjpn committed Oct 8, 2023
1 parent 10c0099 commit c8b742f
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
paths-ignore:
- '**.md'
env:
isPullRequest: ${{ github.event_name == 'pull_request' }}
pullRequestSourceBranch: ${{ github.ref }}
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:
Expand Down Expand Up @@ -79,8 +77,6 @@ jobs:
- name: Output Variables
shell: pwsh
run: |
echo "pullRequestSourceBranch: ${{ env.pullRequestSourceBranch }}"
echo "isPullRequest: ${{ env.isPullRequest }}"
echo "os: ${{ env.os }}"
echo "databaseServerType: ${{ env.databaseServerType }}"
echo "databaseServerVersion: ${{ env.databaseServerVersion }}"
Expand All @@ -92,19 +88,6 @@ jobs:
echo "clientExecutable: ${{ env.clientExecutable }}"
echo "clientCommandPrefix: ${{ env.clientCommandPrefix }}"
echo "windowsUserTempLocation: ${{ env.windowsUserTempLocation }}"
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: .NET Information
shell: pwsh
run: |
dotnet --info
- name: Install EF Core Tools
shell: pwsh
run: |
dotnet tool restore
dotnet ef --version
- name: Cache - Database Image - Linux
id: cache-databaseImage-linux
uses: actions/cache@v3
Expand Down Expand Up @@ -220,6 +203,19 @@ jobs:
- name: Database Information
shell: pwsh
run: ${{ env.clientCommandPrefix }} -u root -pPassword12! -e 'SHOW VARIABLES;'
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: .NET Information
shell: pwsh
run: |
dotnet --info
- name: Install EF Core Tools
shell: pwsh
run: |
dotnet tool restore
dotnet ef --version
- name: Restore dependencies
shell: pwsh
run: dotnet restore
Expand Down Expand Up @@ -310,17 +306,21 @@ jobs:
- name: NuGet Pack
shell: pwsh
run: |
$officialBuild = '${{ env.pullRequestSourceBranch }}' -match '(?<=^refs/tags/)\d+\.\d+\.\d+.*$'
$officialBuild = '${{ github.ref }}' -match '(?<=^refs/tags/)\d+\.\d+\.\d+.*$'
$officialVersion = $Matches.0
$wipBuild = '${{ env.pullRequestSourceBranch }}' -match '^refs/heads/.*-wip$'
$ciBuildOnly = $wipBuild -or ('${{ env.pullRequestSourceBranch }}' -match '^refs/heads/(?:master|release/.*)$')
$wipBuild = '${{ github.ref }}' -match '^refs/heads/.*-wip$'
$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)
$pushToAzureArtifacts = $pack
$pushToMygetOrg = $pack
$pushToNugetOrg = $officialBuild
$pushToNugetOrg = $pack -and $officialBuild
echo "pushToAzureArtifacts: $pushToAzureArtifacts"
echo "pushToMygetOrg: $pushToMygetOrg"
echo "pushToNugetOrg: $pushToNugetOrg"
echo "officialBuild: $officialBuild"
echo "officialVersion: $officialVersion"
Expand All @@ -330,10 +330,6 @@ jobs:
echo "buildSha: $buildSha"
echo "pack: $pack"
echo "pushToAzureArtifacts: $pushToAzureArtifacts"
echo "pushToMygetOrg: $pushToMygetOrg"
echo "pushToNugetOrg: $pushToNugetOrg"
if ($pack)
{
$projectFiles = Get-ChildItem src/*/*.csproj -Recurse | % { $_.FullName }
Expand Down

0 comments on commit c8b742f

Please sign in to comment.