-
Notifications
You must be signed in to change notification settings - Fork 19
42 lines (34 loc) · 1.72 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
name: Build and Publish Package
on:
# run it on push to the default repository branch
push:
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: 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: Publish Packages
env:
SKYWARDNUGETAPIKEY: ${{ secrets.SKYWARDNUGETAPIKEY }}
run: cd publish && for fileName in *.nupkg; do echo ${fileName}; dotnet nuget push -k "$SKYWARDNUGETAPIKEY" -s https://api.nuget.org/v3/index.json ${fileName} || :; done