Skip to content

Create dotnet-build.yml #1

Create dotnet-build.yml

Create dotnet-build.yml #1

Workflow file for this run

name: ASP.NET Build and Veracode Scan
on:
push:
branches:
- main
jobs:
build:
runs-on: windows-latest
env:
solution: 'Verademo-dotnet.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v3
# Setup NuGet
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
# Restore NuGet packages (using the .sln file)
- name: Restore NuGet Packages
run: nuget restore ${{ env.solution }}
# Build the solution
- name: Build Solution
run: |
msbuild ${{ env.solution }} /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="${{ github.workspace }}/artifacts" /p:Platform="${{ env.buildPlatform }}" /p:Configuration="${{ env.buildConfiguration }}"
# Download and run Veracode Static Pipeline Scanner
- name: Veracode Static Pipeline Scanner
run: |
curl -sSO https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip
unzip -o pipeline-scan-LATEST.zip
java -jar pipeline-scan.jar -vid ${{ secrets.VERACODE_API_ID }} -vkey ${{ secrets.VERACODE_API_KEY }} -f "${{ github.workspace }}/artifacts/Verademo-dotnet.zip" || true
# Publish artifacts
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: veracode-scan-results
path: results.json