Skip to content

CD

CD #7

Workflow file for this run

name: CD
on:
create:
branches:
- release/**
jobs:
build:
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'Aspire.Hosting.Krakend.sln'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
- name: Get Build Version
run: |
echo "GITHUB_REF=$GITHUB_REF"
branch_name=${GITHUB_REF#refs/heads/}
version=$(./build/GetBuildVersion.sh ${branch_name#*/})
echo "BUILD_VERSION=$version" >> $GITHUB_ENV
shell: bash
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4
with:
dotnet-version: '8.0.x'
- name: Build
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION
- name: Publish
if: startsWith(github.ref, 'refs/heads/release')
run: |
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}