removing github packages as they *SUCK* #25
Workflow file for this run
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 NuGet Packages | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
- name: Extract version from tag | |
id: extract_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Restore workloads | |
run: dotnet workload restore | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build solution | |
run: dotnet build --configuration Release --no-restore /p:Version=${{ env.VERSION }} | |
- name: Pack NuGet packages | |
run: dotnet pack --configuration Release --no-build --output ./nupkgs /p:PackageVersion=${{ env.VERSION }} | |
- name: Create nuget.config | |
run: | | |
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> | |
<configuration> | |
<packageSources> | |
<add key=\"github\" value=\"https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json\" /> | |
</packageSources> | |
<packageSourceCredentials> | |
<github> | |
<add key=\"Username\" value=\"Systemorph\" /> | |
<add key=\"ClearTextPassword\" value=\"${{ secrets.GH_PAT }}\" /> | |
</github> | |
</packageSourceCredentials> | |
</configuration>" > nuget.config | |
- name: publish to nuget.org | |
run: dotnet nuget push ./nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PAT }} |