-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (75 loc) · 2.22 KB
/
integration-hub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Integration.Hub
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
paths:
- src/Integration.Hub/**
- .github/workflows/integration-hub.yml
- .github/workflows/composite/**
env:
#For build process
owner: onurkanbakirci
repo: Integration
project_path: ./src/Integration.Hub/
nupkg_path: ./src/Integration.Hub/bin/Release/Integration.Hub.1.0.1.nupkg
nupkg_github_secret: ${{ secrets.GITHUB_TOKEN }}
nupkg_nuget_secret: ${{ secrets.NUGET_API_KEY }}
github_registry_url: https://nuget.pkg.github.com/onurkanbakirci/index.json
nuget_registry_url: https://api.nuget.org/v3/index.json
jobs:
build_lib:
name: Build Lib
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
cd ${{env.project_path}}
dotnet build --no-restore
test_lib:
name: Test Lib
runs-on: ubuntu-latest
needs: build_lib
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Test
run: |
publish_lib_to_github:
name: Publish Lib to Github
runs-on: ubuntu-latest
needs: test_lib
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Push nuget package to github registry
uses: ./.github/workflows/composite/publish-lib
with:
package_source: ${{ env.github_registry_url }}
path: ${{ env.project_path }}
nupkg_path: ${{ env.nupkg_path }}
api_key: ${{ env.nupkg_github_secret }}
publish_lib_to_nuget:
name: Publish Lib to Nuget
runs-on: ubuntu-latest
needs: test_lib
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Push nuget package to nuget registry
uses: ./.github/workflows/composite/publish-lib
with:
package_source: ${{ env.nuget_registry_url }}
path: ${{ env.project_path }}
nupkg_path: ${{ env.nupkg_path }}
api_key: ${{ env.nupkg_nuget_secret }}