39 lines
935 B
YAML
39 lines
935 B
YAML
|
name: Publish NuGets
|
||
|
|
||
|
on:
|
||
|
release:
|
||
|
published:
|
||
|
- tag
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout code
|
||
|
uses: actions/checkout@v3
|
||
|
|
||
|
- name: Extract Release Version
|
||
|
shell: bash
|
||
|
run: echo "RELEASE_VERSION=${GITEA_TAG_NAME}" >> $GITEA_ENV
|
||
|
|
||
|
- name: Debug Release Version
|
||
|
run: echo "RELEASE_VERSION=${RELEASE_VERSION}"
|
||
|
|
||
|
- name: Setup .NET
|
||
|
uses: actions/setup-dotnet@v3
|
||
|
with:
|
||
|
dotnet-version: 8.x
|
||
|
|
||
|
- name: Restore dependencies
|
||
|
run: dotnet restore
|
||
|
|
||
|
- name: Build and Pack NuGet Package
|
||
|
run: dotnet pack -c Release -o ./artifacts -p:Version=${RELEASE_VERSION}
|
||
|
|
||
|
- name: Publish to NuGet.org
|
||
|
env:
|
||
|
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
|
||
|
run: |
|
||
|
dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
|