-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 2.18 KB
/
dotnet-release.yml
File metadata and controls
74 lines (62 loc) · 2.18 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
name: .NET Core Desktop
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
env:
Solution_Name: LibraryManagement.sln
Configuration: Release
steps:
- name: Install 7Zip PowerShell Module
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
- name: Build the application
run: msbuild $env:Solution_Name /t:Build /p:Configuration=$env:Configuration
- name: Create Release content
run: |
powershell Compress-7Zip "_Template" -ArchiveFileName "LibraryManagement-FormTemplate.zip" -Format Zip
powershell Compress-7Zip "LibraryManagement.Forms\bin\${{ env.Configuration }}\net6.0-windows\" -ArchiveFileName "LibraryManagement.zip" -Format Zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Library Management asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: LibraryManagement-FormTemplate.zip
asset_name: LibraryManagement-FormTemplate.zip
asset_content_type: application/zip
- name: Upload Template asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: LibraryManagement.zip
asset_name: LibraryManagement.zip
asset_content_type: application/zip