Update dotnet.yml #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: .NET | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup MSBuild v1.1 | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Setup NuGet v2 | |
uses: NuGet/setup-nuget@v2 | |
- name: Restore packages | |
run: nuget restore FriishProduce.sln | |
- name: Build solution | |
run: msbuild FriishProduce\FriishProduce.csproj -t:rebuild -property:Configuration=Release | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT | |
- name: Go to output directory | |
run: cd FriishProduce\bin\Release\ && dir | |
- name: Compress archive | |
run: Compress-Archive -Path * -DestinationPath FriishProduce_latest.zip | |
- name: GH Release | |
uses: softprops/action-gh-release@v2.2.0 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag-name: "latest" | |
name: "Latest Build" | |
body: "${{ steps.date.outputs.date }}" | |
prerelease: true | |
draft: true | |
files: FriishProduce_latest.zip |