You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.2 KiB
84 lines
3.2 KiB
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [ dev, rel/* ]
|
|
tags: [ '*' ]
|
|
pull_request:
|
|
branches: [ dev, rel/* ]
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ macos-latest, ubuntu-latest, windows-latest ]
|
|
include:
|
|
- os: macos-latest
|
|
os_name: macos
|
|
- os: ubuntu-latest
|
|
os_name: linux
|
|
- os: windows-latest
|
|
os_name: windows
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup .NET Core SDK
|
|
uses: actions/setup-dotnet@v1
|
|
|
|
# Arcade only allows the revision to contain up to two characters, and GitHub Actions does not roll-over
|
|
# build numbers every day like Azure DevOps does. To balance these two requirements, set the official
|
|
# build ID to be the same format as the built-in default from Arcade, except with the revision number
|
|
# being the number of the quarter hour of the current time of day (24 * 4 = 96, which is less than 100).
|
|
# So a build between 00:00 and 00:14 would have a revision of 1, and a build between 23:45 and 23:59:59
|
|
# would have a revision of 97.
|
|
- name: Set Build ID
|
|
if: ${{ startsWith(github.ref, 'refs/pull/') == false }}
|
|
shell: pwsh
|
|
run: |
|
|
$Now = (Get-Date).ToUniversalTime()
|
|
$Hours = $Now.Hour * 4
|
|
$QuarterHours = [Math]::Floor($Now.Minute / 15.0)
|
|
$Revision = $Hours + $QuarterHours + 1
|
|
$BuildId = $Now.ToString("yyyyMMdd") + "." + $Revision
|
|
Write-Host "::set-env name=_ComputedOfficialBuildId::${BuildId}"
|
|
|
|
- name: Build, test and pack
|
|
run: eng\common\CIBuild.cmd -configuration Release -prepareMachine -integrationTest
|
|
if: ${{ runner.os == 'Windows' }}
|
|
|
|
- name: Build, test and pack
|
|
shell: pwsh
|
|
run: ./eng/common/cibuild.sh -configuration Release -prepareMachine -integrationTest
|
|
if: ${{ runner.os != 'Windows' }}
|
|
|
|
- name: Publish logs
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: logs-${{ matrix.os_name }}
|
|
path: ./artifacts/log/Release
|
|
|
|
- name: Publish NuGet packages
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: packages-${{ matrix.os_name }}
|
|
path: ./artifacts/packages/Release/Shipping
|
|
|
|
- name: Publish test results
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: testresults-${{ matrix.os_name }}
|
|
path: ./artifacts/TestResults/Release
|
|
|
|
- name: Push NuGet packages to MyGet.org
|
|
run: dotnet nuget push "artifacts\packages\Release\Shipping\*.nupkg" --api-key ${{ secrets.MYGET_API_KEY }} --skip-duplicate --source https://www.myget.org/F/openiddict/ --symbol-source https://www.myget.org/F/openiddict/
|
|
if: ${{ github.repository_owner == 'openiddict' && (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Windows' }}
|
|
|
|
- name: Push NuGet packages to NuGet.org
|
|
run: dotnet nuget push "artifacts\packages\Release\Shipping\*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --source https://api.nuget.org/v3/index.json
|
|
if: ${{ github.repository_owner == 'openiddict' && startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }}
|
|
|