forked from AdhamAwadhi/JamaaSMPP
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (47 loc) · 1.44 KB
/
nuget-deploy.yml
File metadata and controls
48 lines (47 loc) · 1.44 KB
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
name: Build and Deploy Nuget Packages
on:
push:
branches:
- dev
- master
tags:
- v*
pull_request:
branches:
- dev
- master
workflow_dispatch:
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore ./JamaaTech.Smpp.Net.Client/Smpp.Net.Client.csproj
- name: Build
run: dotnet build --no-restore ./JamaaTech.Smpp.Net.Client/Smpp.Net.Client.csproj
- name: Pack
run: dotnet pack --configuration Release ./JamaaTech.Smpp.Net.Client/Smpp.Net.Client.csproj --output nupkgs
- name: Upload artifact for Publish job
uses: actions/upload-artifact@v4
with:
name: .nuget-package
path: nupkgs/*.nupkg
deploy-package:
runs-on: ubuntu-latest
needs:
- build-package
if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }}
steps:
- name: Download artifact from build job
id: download
uses: actions/download-artifact@v4
with:
name: .nuget-package
- name: Publish
run: dotnet nuget push ${{ steps.download.outputs.download-path }}/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json