Browse Source

Switch to GitHub Actions for CI/CD

pull/1005/head
Kévin Chalet 6 years ago
parent
commit
8ef8c038a1
  1. 67
      .github/workflows/build.yml
  2. 22
      .travis.yml
  3. 10
      Directory.Build.props
  4. 3
      README.md
  5. 19
      appveyor.yml

67
.github/workflows/build.yml

@ -0,0 +1,67 @@
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
- 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' }}

22
.travis.yml

@ -1,22 +0,0 @@
language: csharp
mono: none
dist: xenial
addons:
apt:
packages:
- gettext
- libcurl4-openssl-dev
- libicu-dev
- libssl-dev
- libunwind8
- zlib1g
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
os:
- linux
- osx
osx_image: xcode8.2
script:
- ./eng/common/cibuild.sh -configuration Release -prepareMachine -integrationTest

10
Directory.Build.props

@ -49,21 +49,21 @@
</PropertyGroup>
<!--
Arcade only allows the revision to contain up to two characters, and AppVeyor does not roll-over
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.
-->
<PropertyGroup Condition=" '$(APPVEYOR)' == 'True' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)' == '' ">
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' == 'true' AND '$(GITHUB_REF.StartsWith(`refs/pull/`))' == 'false' ">
<_Hours>$([MSBuild]::Multiply($([System.DateTime]::Now.ToString(HH)), 4))</_Hours>
<_QuarterHours>$([MSBuild]::Divide($([System.DateTime]::Now.ToString(mm)), 15))</_QuarterHours>
<_QuarterHours>$([System.Math]::Floor($(_QuarterHours)))</_QuarterHours>
<_AppVeyorBuildRevision>$([MSBuild]::Add($(_Hours), $(_QuarterHours)))</_AppVeyorBuildRevision>
<_AppVeyorBuildRevision>$([MSBuild]::Add($(_AppVeyorBuildRevision), 1))</_AppVeyorBuildRevision>
<_GitHubActionsBuildRevision>$([MSBuild]::Add($(_Hours), $(_QuarterHours)))</_GitHubActionsBuildRevision>
<_GitHubActionsBuildRevision>$([MSBuild]::Add($(_GitHubActionsBuildRevision), 1))</_GitHubActionsBuildRevision>
<OfficialBuild>true</OfficialBuild>
<OfficialBuildId>$([System.DateTime]::Now.ToString(yyyyMMdd)).$(_AppVeyorBuildRevision)</OfficialBuildId>
<OfficialBuildId>$([System.DateTime]::Now.ToString(yyyyMMdd)).$(_GitHubActionsBuildRevision)</OfficialBuildId>
</PropertyGroup>
<ItemGroup>

3
README.md

@ -1,8 +1,7 @@
# OpenIddict
### The OpenID Connect stack you'll be addicted to.
[![Build status](https://ci.appveyor.com/api/projects/status/46ofo2eusje0hcw2/branch/dev?svg=true)](https://ci.appveyor.com/project/openiddict/openiddict-core/branch/dev)
[![Build status](https://travis-ci.org/openiddict/openiddict-core.svg?branch=dev)](https://travis-ci.org/openiddict/openiddict-core)
[![Build status](https://github.com/openiddict/openiddict-core/workflows/build/badge.svg?branch=dev&event=push)](https://github.com/openiddict/openiddict-core/actions?query=workflow%3Abuild+branch%3Adev+event%3Apush)
## What's OpenIddict?

19
appveyor.yml

@ -1,19 +0,0 @@
version: '{build}'
image: Visual Studio 2017
build_script:
- cmd: eng\common\cibuild.cmd -configuration Release -prepareMachine -integrationTest
test: off
artifacts:
- path: artifacts\packages\Release\Shipping\*.nupkg
name: NuGet
deploy:
- provider: NuGet
server: https://www.myget.org/F/openiddict/api/v2/package
api_key:
secure: 0ZVg9vnH4PzTu0CXjTZyDmvvzPMt1R8Yl1ObxleO8dAMk6M1AqmU3YmoaQkc2VNi
skip_symbols: false
symbol_server: https://www.myget.org/F/openiddict/api/v2/package
Loading…
Cancel
Save