Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
soenneker committed Feb 12, 2023
0 parents commit cfd7631
Show file tree
Hide file tree
Showing 12 changed files with 733 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Main
on:
push:
branches:
- main

# Publish `v1.2.3` tags as releases.
tags:
- v*

# Testing - run for any PRs.
pull_request:
branches:
- main
jobs:

# Build, test and publish (if this is a push/merge).
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

publish-package:
needs: build-and-test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3

- name: Setting up build version
run: |
echo "BUILD_VERSION=1.0.$GITHUB_RUN_NUMBER" >> ${GITHUB_ENV}
- name: Setup .NET Core 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Pack
run: dotnet pack --no-build --configuration Release --output .

- name: Publish to nuGet
run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate

- name: Publish to GitHub
run: dotnet nuget push **\*.nupkg --source 'https://nuget.pkg.github.com/soenneker/index.json' --api-key ${{secrets.RELEASE_API_KEY}} --skip-duplicate
Loading

0 comments on commit cfd7631

Please sign in to comment.