-
Notifications
You must be signed in to change notification settings - Fork 1
180 lines (144 loc) · 7.78 KB
/
createrelease.yml
File metadata and controls
180 lines (144 loc) · 7.78 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Release
on:
release:
types: [published]
jobs:
build:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Restore Nuget Packages
run: |
dotnet restore TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet restore TransactionProcessing.MerchantPos/TransactionProcessing.MerchantPos.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet restore TransactionProcessing.MerchantFileProcessor/TransactionProcessing.MerchantFileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- name: Build Code
run: |
dotnet build TransactionProcessing.MerchantPos/TransactionProcessing.MerchantPos.sln --configuration Release
dotnet build TransactionProcessing.MerchantFileProcessor/TransactionProcessing.MerchantFileProcessor.sln --configuration Release
- name: Publish API
run: |
dotnet publish "TransactionProcessing.MerchantPos/TransactionProcessing.MerchantPos.csproj" --configuration Release --output TransactionProcessing.MerchantPos/publishOutput -r win-x64 --self-contained
dotnet publish "TransactionProcessing.MerchantFileProcessor/TransactionProcessing.MerchantFileProcessor.csproj" --configuration Release --output TransactionProcessing.MerchantFileProcessor/publishOutput -r win-x64 --self-contained
- name: Build Release Package (Merchant Pos)
run: |
cd /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantPos/publishOutput
zip -r ../merchantpos.zip ./*
echo "Zip file created at: $(realpath ../merchantpos.zip)"
- name: Upload the artifact (Merchant Pos)
uses: actions/upload-artifact@v4.4.0
with:
name: merchantpos
path: /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantPos/merchantpos.zip
- name: Build Release Package (Merchant File Processor)
run: |
cd /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantFileProcessor/publishOutput
zip -r ../merchantfileprocessor.zip ./*
echo "Zip file created at: $(realpath ../merchantfileprocessor.zip)"
- name: Upload the artifact (Merchant File Processor)
uses: actions/upload-artifact@v4.4.0
with:
name: merchantfileprocessor
path: /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantFileProcessor/merchantfileprocessor.zip
deploystaging:
runs-on: [stagingserver, windows]
needs: build
environment: staging
name: "Deploy to Staging"
steps:
- name: Download the artifact (Merchant Pos)
uses: actions/download-artifact@v4.1.8
with:
name: merchantpos
- name: Remove existing Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Merchant Pos)
run: |
Expand-Archive -Path merchantpos.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantpos" -Force
- name: Install as a Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
$servicePath = "C:\txnproc\transactionprocessing\merchantpos\TransactionProcessing.MerchantPos.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
- name: Download the artifact (Merchant File Processor)
uses: actions/download-artifact@v4.1.8
with:
name: merchantfileprocessor
- name: Remove existing Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Merchant File Processor)
run: |
Expand-Archive -Path merchantfileprocessor.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantfileprocessor" -Force
- name: Install as a Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
$servicePath = "C:\txnproc\transactionprocessing\merchantfileprocessor\TransactionProcessing.MerchantFileProcessor.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
deployproduction:
runs-on: [productionserver, windows]
needs: [build, deploystaging]
environment: production
name: "Deploy to Production"
steps:
- name: Remove existing Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Merchant Pos)
run: |
Expand-Archive -Path merchantpos.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantpos" -Force
- name: Install as a Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
$servicePath = "C:\txnproc\transactionprocessing\merchantpos\TransactionProcessor.MerchantPos.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
- name: Remove existing Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Download the artifact (Merchant File Processor)
uses: actions/download-artifact@v4.1.8
with:
name: merchantfileprocessor
- name: Unzip the files (Merchant File Processor)
run: |
Expand-Archive -Path merchantfileprocessor.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantfileprocessor" -Force
- name: Install as a Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
$servicePath = "C:\txnproc\transactionprocessing\merchantfileprocessor\TransactionProcessing.MerchantFileProcessor.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName