Publish Chasm.Compatibility #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish (Chasm.Compatibility.*) | |
run-name: Publish ${{ inputs.project }} | |
permissions: | |
packages: write | |
on: | |
workflow_dispatch: | |
inputs: | |
project: | |
description: The project to publish | |
required: true | |
type: choice | |
options: | |
- Chasm.Compatibility | |
- Chasm.Compatibility.Attributes | |
- Chasm.Compatibility.IndexRange | |
- Chasm.Compatibility.ValueTuple | |
- Chasm.Compatibility.HashCode | |
- Chasm.Compatibility.Unsafe | |
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 Chasm.Compatibility/${{ 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 |