-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (48 loc) · 1.66 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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