UniVertAll v1.1.0 #7
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 Univertall NuGet Package | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
9.0.x | |
- name: Restore dependencies | |
run: dotnet restore src/Univertall/Univertall.csproj | |
- name: Build | |
run: dotnet build src/Univertall/Univertall.csproj --configuration Release --no-restore | |
- name: Restore test project dependencies | |
run: dotnet restore tests/Univertall.Tests/Univertall.Tests.csproj | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
- name: Set version | |
id: version | |
run: | | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
VERSION=${GITHUB_REF#refs/tags/v} | |
else | |
VERSION=1.0.0 | |
fi | |
echo "::set-output name=version::$VERSION" | |
- name: Pack | |
run: dotnet pack src/Univertall/Univertall.csproj --configuration Release --no-build /p:PackageVersion=${{ steps.version.outputs.version }} --output ./nupkg | |
- name: Publish to NuGet | |
run: dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |