Files
actions/csharp-publish/action.yml
renovate[bot] 5378420242 fix(github-action): update actions/setup-dotnet (v4.3.0 → v4.3.1) (#82)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 10:07:50 +00:00

57 lines
1.6 KiB
YAML

---
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
name: C# Publish
description: 'Publishes a C# project to GitHub Packages.'
author: 'Ismo Vuorinen'
branding:
icon: package
color: blue
inputs:
dotnet-version:
description: 'Version of .NET SDK to use.'
required: false
namespace:
description: 'GitHub namespace for the package.'
required: true
default: 'ivuorinen'
runs:
using: composite
steps:
- name: Detect .NET SDK Version
uses: ivuorinen/actions/dotnet-version-detect@main
with:
default-version: '7.0'
- name: Setup .NET SDK
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '${{ steps.detect-dotnet-version.outputs.dotnet-version }}'
- name: Restore Dependencies
shell: bash
run: dotnet restore
- name: Build Solution
shell: bash
run: dotnet build --configuration Release --no-restore
- name: Pack Solution
shell: bash
run: dotnet pack --configuration Release --output ./artifacts
- name: Publish Package
shell: bash
run: dotnet nuget push ./artifacts/*.nupkg \
--api-key ${{ github.token }} \
--source "https://nuget.pkg.github.com/${{ inputs.namespace }}/index.json" \
--skip-duplicate \
--no-symbols \
|| (sleep 5 && dotnet nuget push ./artifacts/*.nupkg \
--api-key ${{ github.token }} \
--source "https://nuget.pkg.github.com/${{ inputs.namespace }}/index.json" \
--skip-duplicate \
--no-symbols)