microting/eform-sdk-dotnet

View on GitHub
.github/workflows/dotnet-core.yml

Summary

Maintainability
Test Coverage
name: Version release

on:
  push:
    tags:
      - 'v*.*.*'
    paths-ignore:
    - '**.md'
    - '.github/**'

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        test: [integration-tests-core-base,integration-tests-core-case,integration-tests-core-checklists,integration-tests-sqlcontroller-base,integration-tests-sqlcontroller-case,integration-tests-sqlcontroller-checklists,unit-tests-base,unit-tests-checklists,unit-tests-insight]
    steps:
    - uses: actions/checkout@v3
    - name: Start rabbitmq
      run: |
        docker pull rabbitmq:latest
        docker run -d --hostname my-rabbit --name some-rabbit -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password -p5672:5672 rabbitmq:latest
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: 8.0.x
    - name: Install dependencies
      run: dotnet restore
    - name: Get the version
      id: get_version
      run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d 'v' -f 2)" >> $GITHUB_OUTPUT
    - name: Build
      run: dotnet build --configuration Release --no-restore
    - name: ${{matrix.test}}
      run: ./${{matrix.test}}.sh

  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: 8.0.x
    - name: Install dependencies
      run: dotnet restore
    - name: Get the version
      id: get_version
      run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d 'v' -f 2)" >> $GITHUB_OUTPUT
    - name: Build
      run: dotnet build --configuration Release --no-restore
    - name: Pack
      run: dotnet pack eFormCore/Microting.eForm.csproj -c Release -o ./artifacts -p:PackageVersion=${{ steps.get_version.outputs.VERSION }}
    - name: Push generated package to GitHub registry
      run: dotnet nuget push /home/runner/work/eform-sdk-dotnet/eform-sdk-dotnet/artifacts/Microting.eForm.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols