Skip to content

Publish Chasm.Collections #26

Publish Chasm.Collections

Publish Chasm.Collections #26

Workflow file for this run

name: Publish to NuGet and GitHub
run-name: Publish ${{ inputs.project }}
permissions:
packages: write
on:
workflow_dispatch:
inputs:
project:
description: The project to publish
required: true
type: choice
options:
- Chasm.Utilities
- Chasm.Collections
- Chasm.Formatting
- Chasm.SemanticVersioning
jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- name: Install dependencies
run: dotnet restore
- name: Compile ${{ inputs.project }}
run: |
mkdir __out
dotnet pack ${{ inputs.project }} -c Release -o __out -p:WorkflowPublishingPackage=true --no-restore
- name: Publish ${{ inputs.project }} to NuGet
run: |
dotnet nuget push "./__out/*.nupkg" --skip-duplicate -n \
-s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
- name: Publish ${{ inputs.project }} to GitHub
run: |
dotnet nuget push "./__out/*.nupkg" --skip-duplicate -n \
-s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -k ${{ secrets.GITHUB_TOKEN }}
- name: Remove temporary files
run: |
rm -rf __out