Update dotnet.yml #13
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" ] | |
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:build /restore /p:DeleteExistingFiles=False /p:PublishUrl="../_build" | |
- name: Create archive | |
run: cd $GITHUB_WORKSPACE/_build && zip -r FriishProduce_latest.zip * | |
- name: Get current date | |
id: date | |
run: cd $GITHUB_WORKSPACE && echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: latest | |
release_name: Latest Build (${{ steps.date.outputs.date }}) | |
draft: true | |
prerelease: true | |
- name: Upload release | |
id: upload_release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: /FriishProduce_latest.zip | |
asset_name: FriishProduce_latest.zip | |
asset_content_type: application/zip |