Skip to content

Commit

Permalink
feat: Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jandini committed Jan 12, 2022
1 parent c258599 commit 2fca293
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# .NET workflow with private github packages
name: .NET

env:
# repository secret PACKAGES_TOKEN is required to access private packages
NUGET_AUTH_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true

on:
push:
branches: [ develop, master, feature/* ]
pull_request:
branches: [ develop, master ]

defaults:
run:
working-directory: src

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
- name: Restore dependencies
run:
dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
41 changes: 41 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: NuGet

on:
push:
branches: [ 'master' ]

defaults:
run:
working-directory: src

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
NUGET_AUTH_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

jobs:
nuget:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json

- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack
run: dotnet pack --configuration Release --no-restore
- name: Push
run: dotnet nuget push "../bin/**/*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate

0 comments on commit 2fca293

Please sign in to comment.