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

add github actions and makefile #3

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: build

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Info
run: echo 'Building ${{ github.ref }}'

- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.11.0
with:
mongodb-version: '8.0'

- name: Build & Test
run: make test config=Release

publish:
if: contains(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest

steps:
- name: Info
run: echo 'Building ${{ github.ref }}'

- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100

- name: Build nuget
run: make nuget config=Release version=${GITHUB_REF#refs/tags/}

- name: publish nuget
run: make publish nugetkey=${{secrets.NUGET_KEY}}
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
config ?= Debug
version ?= 0.0.0


build:
dotnet build

test:
dotnet test

nuget:
dotnet pack -c $(config) -p:Version=$(version) -o .out

publish: .out/*.nupkg
@for file in $^ ; do \
dotnet nuget push $$file -k $(nugetkey) -s https://api.nuget.org/v3/index.json --skip-duplicate ; \
done
Loading