-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (67 loc) · 2.76 KB
/
Copy pathdotnet-desktop.yml
File metadata and controls
80 lines (67 loc) · 2.76 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Windows
# https://github.com/actions/virtual-environments
on:
push:
tags:
- 'v\d+\.?\d+\.?\d+\.?'
workflow_dispatch:
env:
DOTNETVERSION: 6.0.x
jobs:
build-mac:
runs-on: windows-latest
env:
build_path: src\DotnetDumpMonitor\bin\Release\net6.0-windows\win-x64\publish
zip_name_without_framework: dotnet-dump-monitor-without-framework.zip
zip_name_with_framework: dotnet-dump-monitor-with-framework.zip
name: Windows Build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract version from tag
uses: damienaicheh/extract-version-from-tag-action@v1.1.0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{env.DOTNETVERSION}}
include-prerelease: true
- name: Install 7Zip PowerShell Module
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose
- name: Remove File
uses: JesseTG/rm@v1.0.3
with:
path: ${{ env.build_path }}
- name: Restore Dependencies
run: dotnet restore src/DotnetDumpMonitor/DotnetDumpMonitor.csproj
- name: Build App without framework
run: dotnet publish src/DotnetDumpMonitor/DotnetDumpMonitor.csproj -c Release -r win-x64 --self-contained false /p:PublishSingleFile=true /p:Version='${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.${{ env.NUMBER_OF_COMMITS }}'
- name: Upload Artifact
uses: actions/upload-artifact@v2.3.1
with:
name: windows-ci-build
path: ${{ env.build_path }}
- name: Zip the artifacts
shell: powershell
run: Compress-7Zip ${{ env.build_path }} -ArchiveFileName ${{ env.zip_name_without_framework }} -Format Zip
- name: Build App with framework
run: dotnet publish src/DotnetDumpMonitor/DotnetDumpMonitor.csproj -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:Version='${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.${{ env.NUMBER_OF_COMMITS }}'
- name: Upload Artifact
uses: actions/upload-artifact@v2.3.1
with:
name: windows-ci-build
path: ${{ env.build_path }}
- name: Zip the artifacts
shell: powershell
run: Compress-7Zip ${{ env.build_path }} -ArchiveFileName ${{ env.zip_name_with_framework }} -Format Zip
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: false
title: Release ${{ github.ref_name }}
files: |
./${{ env.zip_name_without_framework }}
./${{ env.zip_name_with_framework }}