Skip to content

ci: configure .NET SDK to support both 6.0.x and 8.0.x versions in pu… #31

ci: configure .NET SDK to support both 6.0.x and 8.0.x versions in pu…

ci: configure .NET SDK to support both 6.0.x and 8.0.x versions in pu… #31

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Publish
on:
push:
tags:
- '*'
branches:
- main
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUKE_TELEMETRY_OPTOUT: true
jobs:
###################################################
# BUILD, TEST & PACK
###################################################
build:
name: Build
if: |
(!startsWith(github.event.head_commit.message, 'skip-ci')
&& !startsWith(github.event.head_commit.message, 'chore:'))
|| startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v5
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
- name: Run './build.sh Compile Test Pack'
run: ./build.sh Compile Test Pack
- name: Upload a Build Artifact
uses: actions/upload-artifact@v7
with:
name: output
path: output
###################################################
# PUBLISH
###################################################
publish:
name: Publish NuGet Packages
needs: [build]
if: "!contains(github.event.head_commit.message, 'skip-ci') || startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v5
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
- name: Download a Build Artifact
uses: actions/download-artifact@v8
with:
name: output
path: output
- name: Run './build.sh Publish'
run: ./build.sh Publish
env:
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}