Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
ci: update ci/cd workflows (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson Parente committed Dec 21, 2020
1 parent 4601bd2 commit ab71446
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/branches.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build Branch
name: Build

on:
pull_request:

push:
branches:
- '**'
- '!master'
branches: [ master ]

jobs:
build:
Expand All @@ -13,13 +13,17 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.1'

- name: Install dependencies
run: dotnet restore ./IdentityServer4.Contrib.TokenExchange.sln

- name: Build
run: dotnet pack ./IdentityServer4.Contrib.TokenExchange.sln -c Release /p:VersionPrefix="1.0" -o ./drop --include-source --include-symbols
run: dotnet build ./IdentityServer4.Contrib.TokenExchange.sln -c Release

- name: Test
run: dotnet test tests/IdentityServer4.Contrib.TokenExchange.Tests/IdentityServer4.Contrib.TokenExchange.Tests.csproj -c Release --no-restore --verbosity normal
28 changes: 17 additions & 11 deletions .github/workflows/master.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
name: Build Master
name: Publish

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published]

jobs:
build:

release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.1'

- name: Install dependencies
run: dotnet restore ./IdentityServer4.Contrib.TokenExchange.sln
- name: Build
run: dotnet pack ./IdentityServer4.Contrib.TokenExchange.sln -c Release /p:VersionPrefix="1.0" -o ./drop --include-source --include-symbols

- name: Test
run: dotnet test tests/IdentityServer4.Contrib.TokenExchange.Tests/IdentityServer4.Contrib.TokenExchange.Tests.csproj -c Release --no-restore --verbosity normal
# - name: push to nuget
# run: dotnet nuget push ./drop/*.nupkg -k ${{ secrets.nuget_secret }} -s https://api.nuget.org/v3/index.json --skip-duplicate

- name: Pack
run: dotnet pack ./IdentityServer4.Contrib.TokenExchange.sln -c Release /p:Version=${{ github.event.release.tag_name }} -o ./drop


- name: Publish
run: dotnet nuget push ./src/**/drop/*.nupkg -k ${{ secrets.NUGET_PUBLISH_KEY }} -s https://api.nuget.org/v3/index.json

- name: Print Version
run: echo ${{ github.event.release.tag_name }}

0 comments on commit ab71446

Please sign in to comment.