From 00b5bf3242b0d78706570bd4fc87e423965a9a58 Mon Sep 17 00:00:00 2001 From: Miha Kralj Date: Tue, 8 Oct 2024 14:20:13 -0700 Subject: [PATCH] nuget publish --- .github/workflows/Publish.yml | 77 +++++++++++++------------- .github/workflows/securitycodescan.yml | 57 ------------------- 2 files changed, 39 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/securitycodescan.yml diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index c6cc6d3d..4be1d359 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -1,6 +1,6 @@ # This workflow integrates SonarCloud analysis, coverage reporting, # CodeQL analysis, SecurityCodeScan, and Codacy Security Scan -# for code scanning and vulnerability detection. +# for code scanning and vulnerability detection - and if they all pass, publish name: Publish Workflow @@ -150,42 +150,42 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 -# converting SARIF action not working yet. - #SecurityCodeScan: - # runs-on: windows-latest - # steps: - # - name: Checkout repository - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 -# - # - name: Setup NuGet - # uses: nuget/setup-nuget@v1 -# - # - name: Setup MSBuild - # uses: microsoft/setup-msbuild@v1 -# - # - name: Setup .NET SDK - # uses: actions/setup-dotnet@v3 - # with: - # dotnet-version: | - # 8.x - # 3.1.x - # dotnet-quality: 'preview' -# - # - name: Set up projects for analysis - # uses: security-code-scan/security-code-scan-add-action@v1 -# - # - name: Build - # run: | - # dotnet restore - # dotnet build --no-restore --configuration Debug -# - # - name: Convert SARIF for uploading to GitHub - # uses: security-code-scan/security-code-scan-results-action@v1 -# - # - name: Upload SARIF - # uses: github/codeql-action/upload-sarif@v3 + + SecurityCodeScan: + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup NuGet + uses: nuget/setup-nuget@v1 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 8.x + 3.1.x + dotnet-quality: 'preview' + + - name: Set up projects for analysis + uses: security-code-scan/security-code-scan-add-action@v1 + + - name: Build + run: | + dotnet restore + dotnet build --no-restore --configuration Debug + + - name: Convert SARIF for uploading to GitHub + uses: security-code-scan/security-code-scan-results-action@v1 + + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@v3 Codacy_Scan: runs-on: ubuntu-latest @@ -304,7 +304,8 @@ jobs: - name: Push release package to nuget.org if: ${{ github.ref == 'refs/heads/main' }} - run: dotnet nuget push 'lib/bin/Release/QuanTAlib.*.nupkg' \ + run: | + dotnet nuget push 'lib/bin/Release/QuanTAlib.*.nupkg' \ --source https://api.nuget.org/v3/index.json \ --skip-duplicate \ --api-key ${{ secrets.NUGET_DEPLOY_KEY_QUANTLIB }} \ No newline at end of file diff --git a/.github/workflows/securitycodescan.yml b/.github/workflows/securitycodescan.yml deleted file mode 100644 index 124eec2a..00000000 --- a/.github/workflows/securitycodescan.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Code Analysis - -on: - push: # Triggers on push events to any branch - pull_request: # Triggers on pull request events targeting any branch - workflow_dispatch: # Allows manual triggering of the workflow - -permissions: - pull-requests: read # Allows SonarCloud to decorate PRs with analysis results - -jobs: - SonarCloud-Analysis: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET 8.0 SDK - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '8.0.x' - - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@v2.2.0 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - args: > - -Dsonar.projectKey=mihakralj_QuanTAlib - -Dsonar.organization=mihakralj - projectBaseDir: . - - SecurityCodeScan: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: nuget/setup-nuget@v1 - - uses: microsoft/setup-msbuild@v1 - - - name: Setup .NET 8.0 SDK - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '8.0.x' - - - name: Set up projects for analysis - uses: security-code-scan/security-code-scan-add-action@v1 - - - name: Restore dependencies - run: dotnet restore - - - name: Build - run: dotnet build --no-restore - - - name: Convert SARIF for uploading to GitHub - uses: security-code-scan/security-code-scan-results-action@v1 - - - name: Upload SARIF - uses: github/codeql-action/upload-sarif@v3