Skip to content

Commit 7908d33

Browse files
committed
Update Workflows
1 parent 56e7d67 commit 7908d33

2 files changed

Lines changed: 22 additions & 19 deletions

File tree

.github/workflows/CI.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build
22

33
on:
4+
workflow_call:
45
push:
56
pull_request:
67

@@ -19,3 +20,11 @@ jobs:
1920
run: dotnet build -c Release --no-restore
2021
- name: Test
2122
run: dotnet test -c Release --no-build --verbosity normal
23+
- name: Pack
24+
run: dotnet pack -c Release --no-build -o nupkgs
25+
- uses: actions/cache@v2
26+
id: restore-build
27+
with:
28+
path: ./*
29+
key: ${{ github.sha }}
30+

.github/workflows/Release.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,23 @@
33
on:
44
push:
55
tags:
6+
- "*"
67

78
jobs:
89
build:
10+
uses: ./.github/workflows/CI.yml
11+
release:
12+
needs: [build]
913
runs-on: ubuntu-latest
1014
steps:
11-
- uses: actions/checkout@v3
12-
- name: Set Up .NET
13-
uses: actions/setup-dotnet@v2
15+
- uses: actions/cache@v3
16+
id: restore-build
1417
with:
15-
dotnet-version: 6.0.x
16-
- name: Restore
17-
run: dotnet restore
18-
- name: Build
19-
run: dotnet build -c Release --no-restore
20-
- name: Test
21-
run: dotnet test -c Release --no-build --verbosity normal
22-
- name: Pack
23-
run: dotnet pack -c Release --no-build -o nupkgs
24-
- name: print
25-
run: ls
26-
- name: Publish
27-
uses: actions/upload-artifact@v3
18+
path: ./*
19+
key: ${{ github.sha }}
20+
- name: Create GitHub release
21+
uses: softprops/action-gh-release@v1
2822
with:
29-
name: packages
30-
path: nupkgs/*
31-
if-no-files-found: error
23+
files: |
24+
${{ github.workspace }}/nupkgs/*.nupkg
25+
tag_name: ${{ steps.tagName.outputs.tag }}

0 commit comments

Comments
 (0)