Skip to content

Updated build workflow. #8

Updated build workflow.

Updated build workflow. #8

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build
env:
ARTIFACT: SAM
PACKAGES: ${{ github.workspace }}\.nuget\packages
on:
workflow_call:
workflow_dispatch:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- id: cache-restore
uses: actions/cache/restore@v3
with:
path: ${{ env.PACKAGES }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore .\src\SAM.sln --packages ${{ env.PACKAGES }}
- id: cache-save
uses: actions/cache/save@v3
with:
path: ${{ env.PACKAGES }}
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
- name: Publish
run: dotnet publish .\src\SAM\SAM.csproj -c Debug -a x86 -o publish --no-restore
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: ${{ env.ARTIFACT }}
path: publish
if-no-files-found: error