-
Notifications
You must be signed in to change notification settings - Fork 19
51 lines (40 loc) · 1.9 KB
/
main.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
name: Build and Publish Package
on:
# run it on push to the default repository branch
push:
branches:
- ci
tags:
- /^release/
jobs:
# define job to build and publish
build-and-push-package:
name: Build Docker image and push to repositories
# run only when code is compiling and tests are passing
runs-on: ubuntu-latest
# steps to perform in job
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/[email protected]
with:
dotnet-version: 8
# Build
- name: Change Directory
run: cd dotnet
- name: Build Core
run: cd dotnet && dotnet build --ignore-failed-sources -c ${PublishConfiguration:-Release} PopcornNetStandard/PopcornNetStandard.csproj
- name: Package Core
run: cd dotnet && dotnet pack -c ${PublishConfiguration:-Release} --include-source --include-symbols -p:SymbolPackageFormat=snupkg --output ../publish PopcornNetStandard/PopcornNetStandard.csproj
- name: Build WebApi
run: cd dotnet && dotnet build --ignore-failed-sources -c ${PublishConfiguration:-Release} PopcornNetStandard.WebApiCore/PopcornNetStandard.WebApiCore.csproj
- name: Package WebApi
run: cd dotnet && dotnet pack -c ${PublishConfiguration:-Release} --include-source --include-symbols -p:SymbolPackageFormat=snupkg --output ../publish PopcornNetStandard.WebApiCore/PopcornNetStandard.WebApiCore.csproj
# Publish
- name: Change Directory
run: cd ../publish
- name: Publish Packages
run: for fileName in *.nupkg; do dotnet nuget push -k $NugetApiKey -s https://api.nuget.org/v3/index.json ${fileName} || :; done
- name: Public Source Mapping
run: for fileName in *.snupkg; do dotnet nuget push -k $NugetApiKey -s https://api.nuget.org/v3/index.json ${fileName} || :; done