Update main.yml #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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: Echo Key | |
run: echo $SKYWARDNUGETAPIKEY | |
- name: Publish Packages | |
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 | |
- name: Public Source Mapping | |
run: cd publish && for fileName in *.snupkg; do echo ${fileName}; dotnet nuget push -k $SKYWARDNUGETAPIKEY -s https://api.nuget.org/v3/index.json ${fileName} || :; done |