Publish NuGet package #89
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 package | |
on: | |
create: | |
tags: | |
- v* | |
jobs: | |
build: | |
env: | |
BUILD_CONFIG: 'Release' | |
SOLUTION: 'TextMateSharp.sln' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/tags/v})" | |
id: extract_branch | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v2 | |
- name: Restore dependencies | |
run: nuget restore $SOLUTION | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
- name: Build | |
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG -p:Version=${{steps.extract_branch.outputs.branch}} --no-restore | |
- name: Run tests | |
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal | |
- name: Publish | |
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} |