Skip to content

Merge pull request #169 from baynezy/dependabot/nuget/Microsoft.NET.T… #331

Merge pull request #169 from baynezy/dependabot/nuget/Microsoft.NET.T…

Merge pull request #169 from baynezy/dependabot/nuget/Microsoft.NET.T… #331

Workflow file for this run

name: CI/CD
env:
VERSION_NUMBER: 2.0.0
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
on:
push:
branches:
- master
- develop
- release/*
pull_request:
branches: [develop]
workflow_dispatch:
jobs:
open-source-scan:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Analyse with FOSSA
uses: fossa-contrib/fossa-action@v3
with:
fossa-api-key: ecbc9c822e743eac0304c1cafcd2136e
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test ./test/DeepSecure.ThreatRemoval.Test/DeepSecure.ThreatRemoval.Test.csproj --no-restore --verbosity normal --logger "junit;LogFileName=results.xml"
- name: Publish Unit Test Results
if: ${{ github.actor != 'dependabot[bot]' }}
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
files: "**/TestResults/*.xml"
publish:
runs-on: ubuntu-latest
needs: [build-and-test,open-source-scan]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Output Version Number
run: echo "Version-$VERSION_NUMBER.$GITHUB_RUN_NUMBER"
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Package
run: dotnet pack ./src/DeepSecure.ThreatRemoval/DeepSecure.ThreatRemoval.csproj -c Release /P:PackageVersion=$VERSION_NUMBER.$GITHUB_RUN_NUMBER
- name: Publish
run: nuget push ./src/DeepSecure.ThreatRemoval/bin/Release/DeepSecure.ThreatRemoval.$VERSION_NUMBER.$GITHUB_RUN_NUMBER.nupkg -ApiKey $NUGET_KEY -NonInteractive -Source https://www.nuget.org/api/v2/package