Cleanup #15
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 Preview to NuGet | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+-preview-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-alpha-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-beta-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-prerelease-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-rc-[0-9]+" | |
jobs: | |
preview: | |
name: Publish Preview | |
runs-on: ubuntu-latest | |
environment: | |
name: "Publish Preview" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Restore Dependencies | |
run: dotnet restore src | |
- name: Build | |
run: dotnet build src --configuration Release --no-restore | |
- name: Set VERSION variable from tag | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
- name: Pack NuGet | |
run: dotnet pack src/Markdown.ColorCode/Markdown.ColorCode.csproj --no-build --configuration Release /p:Version=${VERSION} --output src | |
- name: Pack NuGet | |
run: dotnet pack src/Markdown.ColorCode.CSharpToColoredHtml/Markdown.ColorCode.CSharpToColoredHtml.csproj --no-build --configuration Release /p:Version=${VERSION} --output src | |
- name: Publish NuGet | |
run: dotnet nuget push src/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_KEY} | |
env: | |
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} |