Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #1

Merged
merged 25 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: build

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
Piedone marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Install dependencies
run: dotnet restore -p:NuGetBuild=True
- name: Build
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=True
- name: Test
run: dotnet test --no-restore -p:NuGetBuild=True
Piedone marked this conversation as resolved.
Show resolved Hide resolved
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish

on:
workflow_call:
inputs:
source:
required: true
type: string
secrets:
apikey:
required: true
Piedone marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get the version
id: get_version
run: |
VERSION="${GITHUB_REF_NAME//v}"
echo VERSION:${VERSION}
echo ::set-output name=VERSION::${VERSION}
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Install dependencies
run: dotnet restore -p:NuGetBuild=True
- name: Build
run: dotnet build --configuration Release --no-restore -p:NuGetBuild=True
- name: Test
run: dotnet test --no-restore -p:NuGetBuild=True
Piedone marked this conversation as resolved.
Show resolved Hide resolved
- name: Pack
run: dotnet pack --output artifacts --configuration Release --no-restore --no-build -p:NuGetBuild=True -p:Version=${{ steps.get_version.outputs.VERSION }} -p:TreatWarningsAsErrors=false
Piedone marked this conversation as resolved.
Show resolved Hide resolved
- name: Push with dotnet
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.apikey }} --source ${{ inputs.source }} --skip-duplicate
Piedone marked this conversation as resolved.
Show resolved Hide resolved
- name: Archive artifacts
uses: actions/upload-artifact@v1
with:
name: artifacts
path: artifacts