-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (68 loc) · 2.39 KB
/
pack.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: CI Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
concurrency:
group: CI-Build
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository being compiled
uses: actions/checkout@v3
with:
path: Repo
- name: Checkout the Packages repository alongside the one being compiled
uses: actions/checkout@v3
with:
repository: dgmjr-io/Packages
path: Packages
- name: Run setup-dgmjrsdk
uses: dgmjr-actions/setup-dgmjrsdk@main
with:
git-token: ${{ secrets.GITHUB_TOKEN }}
environment: Release
git-nuget-endpoint: ${{ vars.GIT_NUGET_ENDPOINT }}
private-nuget-endpoint: ${{ vars.PROGET_ENDPOINT_URL }}
private-nuget-api-key: ${{ secrets.PROGET_API_KEY }}
- name: Restore dependencies
run: dotnet restore Repo/src/DgmjrSdk.nuproj
- name: Build
run: dotnet msbuild Repo/src/DgmjrSdk.nuproj -c:Release
- name: Upload the NuGet Package
uses: actions/[email protected]
with:
# Artifact name
name: DgmjrSdk-NuGetPackage
# A file, directory or wildcard pattern that describes what to upload
path: "**/*.nupkg"
# The desired behavior if no files are found using the provided path.
if-no-files-found: error
retention-days: 1
push-nuget:
needs: build
runs-on: ubuntu-latest
steps:
- name: Run setup-dgmjrsdk
uses: dgmjr-actions/setup-dgmjrsdk@main
with:
git-token: ${{ secrets.GITHUB_TOKEN }}
environment: Release
git-nuget-endpoint: ${{ vars.GIT_NUGET_ENDPOINT }}
private-nuget-endpoint: ${{ vars.PROGET_ENDPOINT_URL }}
private-nuget-api-key: ${{ secrets.PROGET_API_KEY }}
- name: Download NuGet Package
uses: actions/[email protected]
with:
name: DgmjrSdk-NuGetPackage
# - name: Publish NuGet to GitHub
# shell: bash
# run: dotnet nuget push **/*.nupkg --source GitHub --api-key ${{ secrets.GITHUB_TOKEN }}
- name: Publish NuGet DGMJR-IO private feed
shell: bash
run: dotnet nuget push **/*.nupkg --source dgmjr-io --api-key ${{ secrets.PROGET_API_KEY }}