Skip to content

Commit 7c592c7

Browse files
committed
[INFRA] Nuget 빌드자동화
1 parent e1fbb1e commit 7c592c7

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/dotnet-core.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Nuget 빌드 자동스크립트 Doc
2+
3+
4+
## Step1 : 닷넷 빌드
5+
6+
dotnet restore Src/LineDevelopers/LineDevelopers.csproj
7+
8+
dotnet build Src/LineDevelopers/LineDevelopers.csproj --configuration Release --no-restore
9+
10+
11+
## Step2 : Nuget Push
12+
13+
dotnet nuget push Src/LineDevelopers/bin/Release/LineDevelopers.1.0.0.nupkg -k ${{ secrets.NUGET_PUBLIC }} --source "https://api.nuget.org/v3/index.json"
14+
15+
16+
## Nuget 키 등록방법
17+
18+
경로 : Project - Setting - Secrets and variables
19+
20+
Name : NUGET_PUBLIC
21+
22+
|Name|Secret|
23+
|NUGET_PUBLIC|Your Key|
24+
25+
26+
## 태깅규칙
27+
28+
v1.0.0 과 같이 Gthub 태깅을 딸때 작동되며, 해당버전은 NUGET 패키지버전과 일치가 됩니다.
29+
30+
닷넷빌드의 버전과 일치가 되게됨으로 , 태깅을 따기전 빌드의 버전을 맞춰주세요
31+
32+
33+
|태깅버전|바이너리버전|
34+
|v1.0.0|1.0.0|

.github/workflows/dotnet-core.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: .NET Core
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*.*.*' # v1.0.0 과같이 태깅을 달면 배포가 작동됩니다.
8+
env:
9+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Setup .NET
17+
id: vars
18+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
19+
- name: Setup .NET Core
20+
uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: 7.0.306
23+
- name: Install dependencies
24+
run: dotnet restore Src/LineDevelopers/LineDevelopers.csproj
25+
- name: Build
26+
run: dotnet build Src/LineDevelopers/LineDevelopers.csproj --configuration Release --no-restore
27+
- name: Push Nuget registry
28+
run: dotnet nuget push Src/LineDevelopers/bin/Release/LineDevelopers.$(git describe --tags | sed s/[v]//g).nupkg -k ${{ secrets.NUGET_PUBLIC }} --source "https://api.nuget.org/v3/index.json"

0 commit comments

Comments
 (0)