-
Notifications
You must be signed in to change notification settings - Fork 0
257 lines (224 loc) · 7.77 KB
/
Copy pathrelease.yml
File metadata and controls
257 lines (224 loc) · 7.77 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.0.0)'
required: true
type: string
permissions:
contents: write
packages: write
pages: write
id-token: write
jobs:
build-artifacts:
name: Build Release Artifacts
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
artifact_name: network_system-linux-x64
archive_ext: tar.gz
- os: macos-latest
artifact_name: network_system-macos-x64
archive_ext: tar.gz
- os: windows-latest
artifact_name: network_system-windows-x64
archive_ext: zip
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup Build Environment (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build libasio-dev libfmt-dev
- name: Setup Build Environment (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install cmake ninja asio fmt
- name: Setup Build Environment (Windows)
if: startsWith(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-asio
mingw-w64-x86_64-fmt
mingw-w64-x86_64-gcc
- name: Configure CMake (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=install \
-DBUILD_WITH_COMMON_SYSTEM=OFF \
-DBUILD_WITH_LOGGER_SYSTEM=OFF \
-DBUILD_WITH_THREAD_SYSTEM=OFF \
-DBUILD_WITH_CONTAINER_SYSTEM=OFF \
-DBUILD_MESSAGING_BRIDGE=OFF \
-DBUILD_TESTS=ON \
-DBUILD_SAMPLES=OFF
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=install \
-DBUILD_WITH_COMMON_SYSTEM=OFF \
-DBUILD_WITH_LOGGER_SYSTEM=OFF \
-DBUILD_WITH_THREAD_SYSTEM=OFF \
-DBUILD_WITH_CONTAINER_SYSTEM=OFF \
-DBUILD_MESSAGING_BRIDGE=OFF \
-DBUILD_TESTS=ON \
-DBUILD_SAMPLES=OFF
- name: Build (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
cmake --build build --config Release
cmake --install build
- name: Build (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cmake --build build --config Release
cmake --install build
- name: Run Tests (Unix)
if: runner.os != 'Windows'
shell: bash
continue-on-error: true
run: |
cd build
ctest --output-on-failure --timeout 60
- name: Run Tests (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
continue-on-error: true
run: |
cd build
ctest --output-on-failure --timeout 60
- name: Package (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
cd install
tar czf ../${{ matrix.artifact_name }}.${{ matrix.archive_ext }} *
cd ..
if command -v sha256sum &>/dev/null; then
sha256sum ${{ matrix.artifact_name }}.${{ matrix.archive_ext }} > ${{ matrix.artifact_name }}.sha256
else
shasum -a 256 ${{ matrix.artifact_name }}.${{ matrix.archive_ext }} > ${{ matrix.artifact_name }}.sha256
fi
- name: Package (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path install/* -DestinationPath ${{ matrix.artifact_name }}.zip
Get-FileHash ${{ matrix.artifact_name }}.zip -Algorithm SHA256 | Select-Object -ExpandProperty Hash > ${{ matrix.artifact_name }}.sha256
- name: Upload Artifacts
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: ${{ matrix.artifact_name }}
path: |
${{ matrix.artifact_name }}.${{ matrix.archive_ext }}
${{ matrix.artifact_name }}.sha256
retention-days: 7
create-release:
name: Create GitHub Release
needs: build-artifacts
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Download All Artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Generate Release Notes
run: |
VERSION=${{ github.event.inputs.version || github.ref_name }}
echo "# Network System Release $VERSION" > release-notes.md
echo "" >> release-notes.md
echo "## Release Highlights" >> release-notes.md
echo "" >> release-notes.md
# Extract recent changes from CHANGELOG
if [ -f "CHANGELOG.md" ]; then
echo "### Changes" >> release-notes.md
head -n 50 CHANGELOG.md | tail -n 40 >> release-notes.md
fi
echo "" >> release-notes.md
echo "## Performance Metrics" >> release-notes.md
echo "- Average throughput: 305K+ msg/s" >> release-notes.md
echo "- Concurrent connections: 500+" >> release-notes.md
echo "- Latency: < 600us average" >> release-notes.md
echo "" >> release-notes.md
echo "## Installation" >> release-notes.md
echo '```bash' >> release-notes.md
echo "# Download and extract the archive for your platform" >> release-notes.md
echo "tar xzf network_system-<platform>-x64.tar.gz" >> release-notes.md
echo "" >> release-notes.md
echo "# Include in your CMake project" >> release-notes.md
echo "find_package(network_system REQUIRED)" >> release-notes.md
echo "target_link_libraries(your_app network_system::network_system)" >> release-notes.md
echo '```' >> release-notes.md
echo "" >> release-notes.md
echo "## Requirements" >> release-notes.md
echo "- C++20 compatible compiler" >> release-notes.md
echo "- CMake 3.16+" >> release-notes.md
echo "- Standalone ASIO 1.28+ (Boost.ASIO not supported)" >> release-notes.md
echo "" >> release-notes.md
echo "## Checksums" >> release-notes.md
echo '```' >> release-notes.md
find artifacts -name "*.sha256" -exec cat {} \;
echo '```' >> release-notes.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.version || github.ref_name }}
name: Network System ${{ github.event.inputs.version || github.ref_name }}
body_path: release-notes.md
draft: false
prerelease: ${{ contains(github.event.inputs.version || github.ref_name, 'rc') || contains(github.event.inputs.version || github.ref_name, 'beta') }}
files: |
artifacts/**/*.tar.gz
artifacts/**/*.zip
artifacts/**/*.sha256
publish-documentation:
name: Publish Documentation
needs: create-release
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Generate Documentation
run: |
doxygen Doxyfile
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload Documentation
uses: actions/upload-pages-artifact@v4
with:
path: docs/html
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v5