Update release.yml (#129) #30
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: Build & Publish NuGet Package | |
on: | |
push: | |
# Publish semver tags as releases. | |
tags: [ 'v*.*.*' ] | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: "Package version, e.g. 1.10.5" | |
required: true | |
type: string | |
env: | |
VERSION: ${{ inputs.version_number || github.ref_name }} | |
jobs: | |
publish-core: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
cache: true | |
cache-dependency-path: '**/packages.lock.json' | |
dotnet-version: | | |
8.0.x | |
9.0.x | |
- name: Pack | |
run: | | |
dotnet pack --configuration Release --property:Version=${VERSION#v} --output . src/core/SimpleCDN.csproj | |
- name: Push | |
run: | | |
dotnet nuget push SimpleCDN.${VERSION#v}.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
publish-redis-extension: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
cache: true | |
cache-dependency-path: '**/packages.lock.json' | |
dotnet-version: | | |
8.0.x | |
9.0.x | |
- name: Pack | |
run: | | |
dotnet pack --configuration Release --property:Version=${VERSION#v} --output . extensions/Redis/SimpleCDN.Extensions.Redis.csproj | |
- name: Push | |
run: | | |
dotnet nuget push SimpleCDN.Extensions.Redis.${VERSION#v}.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |