-
Notifications
You must be signed in to change notification settings - Fork 8
121 lines (99 loc) · 3.83 KB
/
GenerateRelease-csharp.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Generate Release
on:
workflow_run:
workflows:
- 'Update Version'
types:
- 'completed'
jobs:
build-portable-release:
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
defaults:
run:
shell: |
pwsh -noninteractive -command "try {{ $ErrorActionPreference='Stop'; . '{0}' }} catch {{ Write-Error ""FAILED: $_""; throw; }} if ((Test-Path -LiteralPath variable:\LASTEXITCODE)) {{ exit $LASTEXITCODE }}"
steps:
- uses: actions/checkout@v4
with:
ref: '${{ github.ref }}'
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 6.0.x
- name: Create Staging Directory
run: mkdir "STAGING"
- name: Build VolumeControl Binary (Portable Version)
run: dotnet publish VolumeControl -c Release -p:PublishProfile="VolumeControl/Properties/PublishProfiles/FolderProfile.pubxml"
- name: Stage Binary (Portable Version)
run: foreach($file in $((dir "publish" | where {$_.extension -in ".exe"}).Fullname)){ mv "$file" "STAGING" }
- name: Upload Executable Artifact
uses: actions/upload-artifact@v3
with:
name: portable
path: '${{github.workspace}}/STAGING/*'
if-no-files-found: error
- name: Upload SDK Artifact
uses: actions/upload-artifact@v3
with:
name: sdk
path: '${{github.workspace}}/publish/SDK/*'
if-no-files-found: error
build-installer-release:
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
defaults:
run:
shell: |
pwsh -noninteractive -command "try {{ $ErrorActionPreference='Stop'; . '{0}' }} catch {{ Write-Error ""FAILED: $_""; throw; }} if ((Test-Path -LiteralPath variable:\LASTEXITCODE)) {{ exit $LASTEXITCODE }}"
steps:
- uses: actions/checkout@v4
with:
ref: '${{ github.ref }}'
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 6.0.x
- name: Create Staging Directory
run: mkdir "STAGING"
- name: Prepare Installer Prerequisites
run: git clone https://github.com/DomGries/InnoDependencyInstaller
- name: Build VolumeControl Binary (Installer Version)
run: dotnet publish VolumeControl -c Release-ForInstaller -p:PublishProfile="VolumeControl/Properties/PublishProfiles/PublishForInstaller.pubxml"
- name: Compile VolumeControl Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.1.0
with:
path: vcsetup.iss
options: /Opublish
- name: Stage Installer
run: foreach($file in $((dir "publish" | where {$_.extension -in ".exe"}).Fullname)){ mv "$file" "STAGING" }
- name: Upload Executable Artifact
uses: actions/upload-artifact@v3
with:
name: installer
path: '${{github.workspace}}/STAGING/*'
if-no-files-found: error
create-release:
needs: [ build-portable-release, build-installer-release ]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ${{github.workspace}}
- name: Create SDK Archive
run: |
zip -T9 ./SDK.zip sdk/*
rm -rf sdk
ls -lAghR
- name: 'Create Release'
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
'*/*.exe'
'SDK.zip'