Fix nuget badge (#35) #35
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: CI build | |
env: | |
OUTPUT_PATH: ${{ github.workspace }}/nuget | |
DOTNET_VERSION: | | |
8.0.x | |
6.0.x | |
9.0.x | |
GITHUB_SOURCE: "https://nuget.pkg.github.com/aaronpowell/index.json" | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: CI | |
env: | |
DOTNET_CONFIGURATION: Release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration ${{ env.DOTNET_CONFIGURATION }} | |
- name: Publish NuGet package | |
run: dotnet pack --no-build -c ${{ env.DOTNET_CONFIGURATION }} -o ${{ env.OUTPUT_PATH }} -p:VersionSuffix='alpha.${{ github.run_number }}' | |
- name: Demonstrate against self | |
run: dotnet run --framework net9.0 | |
working-directory: ./src/DotNetDelice | |
- run: ls -la ${{ env.OUTPUT_PATH }} | |
- name: Publish release packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: ${{ env.OUTPUT_PATH }}/** | |
publish-github: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: GitHub Packages | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: ${{ env.OUTPUT_PATH }} | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Publish | |
run: dotnet nuget push --api-key ${{ secrets.GITHUB_TOKEN }} --source ${{ env.GITHUB_SOURCE }} "*.nupkg" | |
working-directory: ${{ env.OUTPUT_PATH }} |