Update dotnet.yml #23
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-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Go to GitHub Workspace | |
run: cd $GITHUB_WORKSPACE | |
- name: Create build directory | |
run: mkdir _build | |
- name: Restore dependencies | |
run: nuget restore FriishProduce.sln | |
- name: Build release | |
run: MSBuild FriishProduce.sln /p:Configuration=Release /p:Platform="Any CPU" /t:publish /restore /p:DeleteExistingFiles=False /p:PublishUrl="_build" | |
- name: Create archive | |
run: Compress-Archive -Path _build/* -Destination FriishProduce_latest.zip | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT | |
- name: Create/Update Github Release | |
uses: mini-bomba/create-github-release@v1.2.0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: "latest" | |
prerelease: true | |
name: "Latest Build (${{ env.GIT_HASH }})" | |
body: "This is the latest build as of ${{ steps.date.outputs.date }}, autogenerated from the most recent commit." | |
files: FriishProduce_latest.zip | |
clear_attachments: true |