Skip to content

Merge pull request #196 from SSchulze1989/develop #45

Merge pull request #196 from SSchulze1989/develop

Merge pull request #196 from SSchulze1989/develop #45

name: .NET
on:
push:
tags:
- "*"
jobs:
publish:
env:
BUILD_CONFIG: Release
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}
TEST_USER: root
TEST_PASSWORD: TestPass123
TEST_DATABASE: TestDatabase
DB_TEST_PROJECT: test/DbIntegrationTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
source-url: https://api.nuget.org/v3/index.json
- name: Setup MySQL
uses: mirromutth/[email protected]
with:
# Required if "mysql user" is empty, default is empty. The root superuser password
mysql root password: $TEST_PASSWORD
# MYSQL_DATABASE - name for the default database that is created
mysql database: $TEST_DATABASE
- name: Set secrets
run: dotnet user-secrets set "ConnectionStrings:ModelDb" "server=localhost;database=$TEST_DATABASE;user=$TEST_USER;password=$TEST_PASSWORD" --project $DB_TEST_PROJECT
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c $BUILD_CONFIG --no-restore
- name: Test
run: dotnet test -c $BUILD_CONFIG --no-build --verbosity normal
- name: Publish
run: dotnet nuget push **\*.nupkg --skip-duplicate -k ${NUGET_AUTH_TOKEN}