Skip to content

Commit

Permalink
housekeeping: Use GitHub Actions (#258)
Browse files Browse the repository at this point in the history
* housekeeping: Use GitHub Actions

* migrate tests you netcoreapp3.1

* migrated api approval to 3.1

* fixing approval

* adding coverlet msbuild

* revert shouldly

* removed cake files

remove azure pipelines yaml

* removed net 4.7.2 test target

* migrated to fluent assertions

* changed README build status
  • Loading branch information
RLittlesII committed Oct 26, 2020
1 parent 97af0c0 commit 3fd846c
Show file tree
Hide file tree
Showing 29 changed files with 268 additions and 364 deletions.
134 changes: 134 additions & 0 deletions .github/workflows/ci-build.yml
@@ -0,0 +1,134 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]

env:
configuration: Release
productNamespacePrefix: "Sextant"

jobs:
build:
runs-on: windows-latest
outputs:
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: NuGet restore
run: dotnet restore
working-directory: src

- name: NBGV
id: nbgv
uses: dotnet/nbgv@master
with:
setAllVars: true

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Build
run: msbuild /t:build,pack /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }}
working-directory: src

- name: Run Unit Tests and Generate Coverage
uses: glennawatson/coverlet-msbuild@v1
with:
project-files: '**/*Tests*.csproj'
no-build: true
exclude-filter: '[${{env.productNamespacePrefix}}*Tests.*]*'
include-filter: '[${{env.productNamespacePrefix}}*]*'
output-format: opencover
merge-with: '../../artifacts/coverage/coverage.json'
output: '../../artifacts/coverage/'
configuration: ${{ env.configuration }}

- name: Combine Coverage Reports
shell: bash
run: |
dotnet tool install --global dotnet-reportgenerator-globaltool
reportgenerator -reports:artifacts/coverage/*.xml -targetdir:artifacts/finalcoverage -reporttypes:Cobertura
- name: Upload Code Coverage
run: |
npm install -g codecov
codecov
working-directory: artifacts/finalcoverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Create NuGet Artifacts
uses: actions/upload-artifact@master
with:
name: nuget
path: '**/*.nupkg'

release:
runs-on: ubuntu-latest
needs: build
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download NuGet Packages
uses: actions/download-artifact@v2
with:
name: nuget

- name: Save SignClient Configuration
run: 'echo "$SIGN_CLIENT_CONFIG" > SignPackages.json'
shell: bash
env:
SIGN_CLIENT_CONFIG: ${{secrets.SIGN_CLIENT_CONFIG}}

- name: Sign NuGet Packages
uses: glennawatson/signclient@v1
with:
input-files: '**/*.nupkg'
sign-client-secret: ${{ secrets.SIGN_CLIENT_SECRET }}
sign-client-user: ${{ secrets.SIGN_CLIENT_USER_ID }}
project-name: reactiveui
description: reactiveui
config-file: SignPackages.json

- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ needs.build.outputs.nbgv }}
release_name: ${{ needs.build.outputs.nbgv }}
body: |
${{ steps.changelog.outputs.commitLog }}
- name: NuGet Push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
## Sextant

[![NuGet Stats](https://img.shields.io/nuget/v/sextant.svg)](https://www.nuget.org/packages/sextant) [![Build Status](https://dev.azure.com/dotnet/ReactiveUI/_apis/build/status/Sextant-CI)](https://dev.azure.com/dotnet/ReactiveUI/_build/latest?definitionId=76) [![Code Coverage](https://codecov.io/gh/reactiveui/sextant/branch/main/graph/badge.svg)](https://codecov.io/gh/reactiveui/sextant)
[![NuGet Stats](https://img.shields.io/nuget/v/sextant.svg)](https://www.nuget.org/packages/sextant) ![Build](https://github.com/reactiveui/Sextant/workflows/Build/badge.svg) [![Code Coverage](https://codecov.io/gh/reactiveui/sextant/branch/main/graph/badge.svg)](https://codecov.io/gh/reactiveui/sextant)
<br>
<a href="https://www.nuget.org/packages/sextant">
<img src="https://img.shields.io/nuget/dt/sextant.svg">
Expand Down
19 changes: 0 additions & 19 deletions azure-pipelines.yml

This file was deleted.

30 changes: 0 additions & 30 deletions build.cake

This file was deleted.

2 changes: 0 additions & 2 deletions build.cmd

This file was deleted.

2 changes: 0 additions & 2 deletions build.config

This file was deleted.

112 changes: 0 additions & 112 deletions build.ps1

This file was deleted.

51 changes: 0 additions & 51 deletions build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions cake.config

This file was deleted.

0 comments on commit 3fd846c

Please sign in to comment.