Skip to content

Commit ba684e0

Browse files
committed
added gitaction
1 parent eb8b49b commit ba684e0

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.github/workflows/build_and_test.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: Build
1+
name: Build test and pack
22

33
on:
44
push:
55
branches: ["main"]
66

7+
pull_request:
8+
branches: ["main"]
9+
710
jobs:
811
build:
912
name: Build test and pack
@@ -22,4 +25,10 @@ jobs:
2225
run: dotnet restore
2326

2427
- name: Build
25-
run: dotnet build ./src/genocs.cli.csproj --no-restore
28+
run: dotnet build --no-restore
29+
30+
- name: Test
31+
run: dotnet test --no-build --verbosity normal
32+
33+
- name: Pack
34+
run: dotnet pack --no-build --verbosity normal
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This is a manually triggered nuget build and deploy
2+
3+
name: Publish on NuGet
4+
5+
# Controls when the action will run. Workflow runs when manually triggered using the UI
6+
# or API.
7+
on:
8+
workflow_dispatch:
9+
# Inputs the workflow accepts.
10+
inputs:
11+
version:
12+
# Friendly description to be shown in the UI instead of 'name'
13+
description: "Packages Version"
14+
15+
# Default value if no value is explicitly provided
16+
default: "5.0.0-preview.4.0"
17+
18+
# Input has to be provided for the workflow to run
19+
required: true
20+
21+
22+
jobs:
23+
build:
24+
name: Update NuGet packages
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v2
32+
with:
33+
dotnet-version: 7.0.x
34+
35+
- name: Restore dependencies
36+
run: dotnet restore
37+
38+
- name: Build
39+
run: dotnet build -c Debug --no-restore
40+
41+
- name: Test
42+
run: dotnet test --no-build --verbosity normal
43+
44+
- name: Pack
45+
run: dotnet pack -c Debug -o out -p:Version=${{ github.event.inputs.version }} --no-build --verbosity normal
46+
47+
- name: Push packages to Nuget
48+
run: dotnet nuget push ./out/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols

0 commit comments

Comments
 (0)