-
Notifications
You must be signed in to change notification settings - Fork 1
175 lines (155 loc) · 5.69 KB
/
react-on-release.yml
File metadata and controls
175 lines (155 loc) · 5.69 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
name: React on Release
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release-cgb:
runs-on: windows-latest
if: startsWith(github.event.release.tag_name, 'ChemGateBuilder@') || github.event_name == 'workflow_dispatch'
steps:
# Step 1: Checkout the repository
-
name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set dotnet SDK
-
name: Setup dotnet SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
# Step 3: Install dependencies
-
name: Install dependencies
run: dotnet restore
# Step 4: Build Executables
-
name: Build
run: dotnet publish src/ChemGateBuilder/ChemGateBuilder.csproj -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true
shell: powershell
# Step 5: Compress to zip
-
name: Compress to zip
run: |
mkdir -p ChemGateBuilder
cp -r src/ChemGateBuilder/bin/Release/net8.0-windows/win-x64/publish/*.exe ChemGateBuilder
cp -r src/ChemGateBuilder/bin/Release/net8.0-windows/win-x64/publish/*.dll ChemGateBuilder
cp src/ChemGateBuilder/README.html ChemGateBuilder
mkdir -p ChemGateBuilder/docs
cp -r src/ChemGateBuilder/docs/images ChemGateBuilder/docs/
7z a -tzip ChemGateBuilder.zip ChemGateBuilder
shell: powershell
# Step 6: Upload Archive as Artifact
-
name: Upload Archive as Artifact
uses: actions/upload-artifact@v4
with:
name: executable-archive
path: |
ChemGateBuilder.zip
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# Step 7: Attach ChemGateBuilder Archive to Release
-
name: Attach ChemGateBuilder Archive to Release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'release' }}
with:
files: ChemGateBuilder.zip
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# Step 8: Add scan with VirusTotal
-
name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
update_release_body: true
vt_api_key: ${{ secrets.VT_API_KEY }}
github_token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
request_rate: 4
files: |
${{ github.event_name == 'release' && '.zip$' || '*.zip' }}
build-and-release-crs:
runs-on: windows-latest
if: startsWith(github.event.release.tag_name, 'ClusterRelocationService@') || github.event_name == 'workflow_dispatch'
steps:
# Step 1: Checkout the repository
-
name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set dotnet SDK
-
name: Setup dotnet SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
# Step 3: Install dependencies
-
name: Install dependencies
run: dotnet restore
# Step 4: Build Executables
-
name: Build
run: dotnet publish src/ClusterRelocationService/ClusterRelocationService.csproj -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true
shell: powershell
# Step 5: Compress to zip
-
name: Compress to zip
run: |
mkdir -p ClusterRelocationService
cp -r src/ClusterRelocationService/bin/Release/net8.0-windows/win-x64/publish/*.exe ClusterRelocationService
cp -r src/ClusterRelocationService/bin/Release/net8.0-windows/win-x64/publish/*.dll ClusterRelocationService
cp src/ClusterRelocationService/README.html ClusterRelocationService
mkdir -p ClusterRelocationService/docs
cp -r src/ClusterRelocationService/docs/images ClusterRelocationService/docs/
7z a -tzip ClusterRelocationService.zip ClusterRelocationService
shell: powershell
# Step 6: Upload Archive as Artifact
-
name: Upload Archive as Artifact
uses: actions/upload-artifact@v4
with:
name: executable-archive
path: |
ClusterRelocationService.zip
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# Step 7: Attach ClusterRelocationService Archive to Release
-
name: Attach ClusterRelocationService Archive to Release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'release' }}
with:
files: ClusterRelocationService.zip
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# Step 8: Add scan with VirusTotal
-
name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
update_release_body: true
vt_api_key: ${{ secrets.VT_API_KEY }}
github_token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
request_rate: 4
files: |
${{ github.event_name == 'release' && '.zip$' || '*.zip' }}
delete-release:
runs-on: ubuntu-latest
if: github.event_name == 'release' && ! startsWith(github.event.release.tag_name, 'ChemGateBuilder@') && ! startsWith(github.event.release.tag_name, 'ClusterRelocationService@')
steps:
# Step 1: Checkout the repository
-
name: Checkout repository
uses: actions/checkout@v4
# Step 2: Delete Release
-
name: Delete Release
run: |
gh release delete ${{ github.event.release.tag_name }} --yes
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}