Browse Source

Split the build step into 3 build/publish-myget/publish-nuget steps

pull/1783/head
Kévin Chalet 3 years ago
parent
commit
eed5745cb6
  1. 69
      .github/workflows/build.yml

69
.github/workflows/build.yml

@ -6,6 +6,17 @@ on:
tags: [ '*' ] tags: [ '*' ]
pull_request: pull_request:
branches: [ dev, rel/* ] branches: [ dev, rel/* ]
workflow_dispatch:
env:
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
NUGET_XMLDOC_MODE: skip
TERM: xterm
permissions:
contents: read
jobs: jobs:
build: build:
@ -17,12 +28,12 @@ jobs:
matrix: matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ] os: [ macos-latest, ubuntu-latest, windows-latest ]
include: include:
- os: macos-latest - os: macos-latest
os_name: macos os_name: macos
- os: ubuntu-latest - os: ubuntu-latest
os_name: linux os_name: linux
- os: windows-latest - os: windows-latest
os_name: windows os_name: windows
steps: steps:
- name: Checkout code - name: Checkout code
@ -61,19 +72,11 @@ jobs:
- name: Build, test and pack - name: Build, test and pack
if: ${{ runner.os == 'Windows' }} if: ${{ runner.os == 'Windows' }}
run: eng\common\CIBuild.cmd -configuration Release -prepareMachine -integrationTest run: eng\common\CIBuild.cmd -configuration Release -prepareMachine -integrationTest
env:
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
- name: Build, test and pack - name: Build, test and pack
if: ${{ runner.os != 'Windows' }} if: ${{ runner.os != 'Windows' }}
shell: pwsh shell: pwsh
run: ./eng/common/cibuild.sh -configuration Release -prepareMachine -integrationTest run: ./eng/common/cibuild.sh -configuration Release -prepareMachine -integrationTest
env:
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
- name: Publish logs - name: Publish logs
if: ${{ always() }} if: ${{ always() }}
@ -95,10 +98,36 @@ jobs:
name: testresults-${{ matrix.os_name }} name: testresults-${{ matrix.os_name }}
path: ./artifacts/TestResults/Release path: ./artifacts/TestResults/Release
- name: Push NuGet packages to MyGet.org push-myget:
if: ${{ github.repository_owner == 'openiddict' && (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Windows' }} needs: build
run: nuget push "artifacts\packages\Release\Shipping\*.nupkg" -ApiKey ${{ secrets.MYGET_API_KEY }} -SkipDuplicate -Source https://www.myget.org/F/openiddict/api/v3/index.json runs-on: ubuntu-latest
if: |
github.event.repository.fork == false &&
(github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/'))
steps:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages-windows
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Push packages to MyGet.org
run: nuget push "*.nupkg" -ApiKey ${{ secrets.MYGET_API_KEY }} -SkipDuplicate -Source https://www.myget.org/F/openiddict/api/v3/index.json
push-nuget:
needs: build
runs-on: ubuntu-latest
if: github.event.repository.fork == false && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages-windows
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Push NuGet packages to NuGet.org - name: Push packages to NuGet.org
if: ${{ github.repository_owner == 'openiddict' && startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }} run: nuget push "*.nupkg" -ApiKey ${{ secrets.NUGET_API_KEY }} -SkipDuplicate -Source https://api.nuget.org/v3/index.json
run: nuget push "artifacts\packages\Release\Shipping\*.nupkg" -ApiKey ${{ secrets.NUGET_API_KEY }} -SkipDuplicate -Source https://api.nuget.org/v3/index.json

Loading…
Cancel
Save