Skip to content

2.0.8-beta.1

2.0.8-beta.1 #47

Workflow file for this run

name: .NET publish
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
env:
BUILD_VERSION: ${{ github.event.release.tag_name }}
NUGET_SOURCE: https://api.nuget.org/v3/index.json
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Set packages authoring information
id: set-packages-authoring-information
run: |
copyright=$(grep -m 1 -P '^Copyright \(c\) [0-9]+ [A-zÀ-ú ,]+' LICENSE.md)
authors=$(grep -m 1 -Po '^Copyright \(c\) [0-9]+ \K([A-zÀ-ú ,]+)' LICENSE.md | sed 's@, @;@')
echo -e "Found information:\n * Copyright message: $copyright\n * Authors: $authors\n * Repository URL: $REPOSITORY_URL"
project_files=$(find ./src -type f -name "*.csproj")
find ./src -type f -name "*.csproj" -print0 | xargs -0 sed -i 's@<RepositoryUrl>.*</RepositoryUrl>@<RepositoryUrl>'"$REPOSITORY_URL"'</RepositoryUrl>@; s@<Authors>.*</Authors>@<Authors>'"$authors"'</Authors>@; s@<Copyright>.*</Copyright>@<Copyright>'"$copyright"'</Copyright>@'
echo -e "Replaced *.csproj files:\n$project_files"
- name: Pack Rules.Framework
run: dotnet pack src/Rules.Framework/Rules.Framework.csproj --include-symbols -c Release /p:Version=$BUILD_VERSION
- name: Pack Rules.Framework.Providers.MongoDb
run: dotnet pack src/Rules.Framework.Providers.MongoDb/Rules.Framework.Providers.MongoDb.csproj --include-symbols -c Release /p:Version=$BUILD_VERSION
- name: Pack Rules.Framework.WebUI
run: dotnet pack src/Rules.Framework.WebUI/Rules.Framework.WebUI.csproj --include-symbols -c Release /p:Version=$BUILD_VERSION
- name: Publish NuGet packages
run: dotnet nuget push **/*.nupkg -s $NUGET_SOURCE -k $NUGET_API_KEY --skip-duplicate