fix: framework version downgrade (#17) #32
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 Differ.DotNet | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "7.0.x" | |
- name: Restore | |
run: dotnet restore ./source/Perun.Differ.sln | |
- name: Test | |
run: dotnet test ./source/Perun.Differ.sln --no-restore | |
- name: Build | |
run: dotnet build ./source/Perun.Differ.sln --configuration Release --no-restore | |
- name: Pack NuGet package | |
run: dotnet pack ./source/Perun.Differ.sln --configuration Release --include-symbols --no-build --no-restore | |
- name: Get NuGet version | |
id: nuget_version | |
run: | | |
version=$(grep -oP '(?<=<Version>).*(?=</Version>)' ./source/Directory.Build.props) | |
echo "::set-output name=version::$version" | |
- name: Publish to NuGet.org | |
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.nuget_version.outputs.version }} | |
release_name: Release ${{ steps.nuget_version.outputs.version }} | |
draft: false | |
prerelease: false |