Skip to content

Update main.yml

Update main.yml #5

Workflow file for this run

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
env:
SUPER_SECRET: ${{ secrets.SKYWARDNUGETAPIKEY }}
run: echo $SKYWARDNUGETAPIKEY
- name: Publish Packages
env:
SUPER_SECRET: ${{ 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
- name: Public Source Mapping
env:
SUPER_SECRET: ${{ secrets.SKYWARDNUGETAPIKEY }}
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