Skip to content

[Pull Request] A project level refactoring #46

[Pull Request] A project level refactoring

[Pull Request] A project level refactoring #46

name: Publish Packages
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build-on-ubuntu:
runs-on: ubuntu-latest
environment: Publish Packages
if: contains(github.event.head_commit.message, '[Publish Packages]')
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
- name: Add to GitHub Repo
run: |
nuget sources add -name github -Source https://nuget.pkg.github.com/Crequency/index.json -Username Crequency -Password ${{ secrets.GitHubToken }}
- name: Install NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: "6.x"
- name: Build and Publish `Cheese`
if: contains(github.event.head_commit.message, '[Cheese]') || contains(github.event.head_commit.message, '[All]')
run: |
cd "KitX SDK"
cd "Cheese"
dotnet build -c Release
nuget push ./bin/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
nuget push ./bin/Release/*.nupkg -Source github -SkipDuplicate
cd "../.."
- name: Build and Publish `KitX.Contract.CSharp`
if: contains(github.event.head_commit.message, '[KitX.Contract.CSharp]') || contains(github.event.head_commit.message, '[All]')
run: |
cd "KitX Standard"
cd "KitX Contracts"
cd "KitX.Contract.CSharp"
dotnet build -c Release
nuget push ./bin/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
nuget push ./bin/Release/*.nupkg -Source github -SkipDuplicate
cd "../../.."
- name: Build and Publish `KitX.Shared`
if: contains(github.event.head_commit.message, '[KitX.Shared]') || contains(github.event.head_commit.message, '[All]')
run: |
cd "KitX Standard"
cd "KitX.Shared"
dotnet build -c Release
nuget push ./bin/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
nuget push ./bin/Release/*.nupkg -Source github -SkipDuplicate
cd "../.."
- name: Build and Publish `KitX.FileFormats`
if: contains(github.event.head_commit.message, '[KitX.FileFormats]') || contains(github.event.head_commit.message, '[All]')
run: |
cd "KitX Standard"
cd "KitX.FileFormats"
dotnet build -c Release
nuget push ./bin/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
nuget push ./bin/Release/*.nupkg -Source github -SkipDuplicate
cd "../.."