-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (161 loc) · 5.32 KB
/
release.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
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
name: Release
on:
release:
types:
- created
push:
tags:
- "v*.*.*"
jobs:
build_linux:
name: Build on Linux
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and tag DevContainer image
run: |
docker build -t linux-container-image -f .devcontainer/Dockerfile .
- name: Run DevContainer and build project
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace -u root linux-container-image \
bash -c "mkdir -p build && cd build && cmake .. && make"
- name: Debug Build Output (Linux)
run: |
echo "Listing build directory:"
ls -la build/
- name: Upload Build Artifacts (Linux)
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: |
build/liaison
build/binaries
build_windows:
name: Build on Windows
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Cache vcpkg
uses: actions/cache@v3
with:
path: C:/vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: Install dependencies
run: |
choco install -y cmake make openssl
- name: Install protobuf, zlib and libzip
run: |
Get-Command vcpkg
vcpkg install protobuf:x64-windows-static
vcpkg install zlib:x64-windows-static
vcpkg install libzip:x64-windows-static
- name: Build and install Zenoh-c
run: |
git clone --depth 1 --branch 1.0.0 https://github.com/eclipse-zenoh/zenoh-c.git
mkdir zenoh-c/build
cd zenoh-c/build
cmake ../ -DBUILD_SHARED_LIBS=FALSE
cmake --build . --config Release --target install
- name: Build and install Zenoh-cpp
run: |
git clone --depth 1 --branch 1.0.0 https://github.com/eclipse-zenoh/zenoh-cpp.git
mkdir zenoh-cpp/build
cd zenoh-cpp/build
cmake ../ -DBUILD_SHARED_LIBS=FALSE
cmake --build . --config Release --target install
- name: Build Liaison
run: |
mkdir -p build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
- name: Debug Build Output
run: |
echo "Listing build directory:"
dir build
dir build\Release
dir build\binaries\x86_64-windows
- name: Upload Build Artifacts (Windows)
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
build\Release\liaison.exe
build\binaries
package:
name: Package Artifacts
needs:
- build_linux
- build_windows
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Download artifacts from both builds
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifacts
path: artifacts/linux
- name: Download Windows Artifacts
uses: actions/download-artifact@v4
with:
name: windows-artifacts
path: artifacts/windows
- name: Debug Artifacts
run: |
echo "Listing artifacts directory:"
ls -la artifacts/
echo "Listing Linux artifacts:"
ls -la artifacts/linux/
echo "Listing Windows artifacts:"
ls -la artifacts/windows/
# Create liaison-linux package
- name: Create liaison-linux package
run: |
mkdir -p package-linux/binaries
cp artifacts/linux/liaison package-linux/
cp -r artifacts/linux/binaries/* package-linux/binaries/
cp -r artifacts/windows/binaries/* package-linux/binaries/
tar -czvf liaison-linux.tar.gz -C package-linux .
# Create liaison-windows package
- name: Create liaison-windows package
run: |
mkdir -p package-windows/binaries
cp artifacts/windows/Release/liaison.exe package-windows/
cp -r artifacts/linux/binaries/* package-windows/binaries/
cp -r artifacts/windows/binaries/* package-windows/binaries/
tar -czvf liaison-windows.tar.gz -C package-windows .
# Upload the packaged artifacts
- name: Upload Packages
uses: actions/upload-artifact@v4
with:
name: liaison-packages
path: |
liaison-linux.tar.gz
liaison-windows.zip
release:
name: Create Release
needs:
- package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Packages
uses: actions/download-artifact@v4
with:
name: liaison-packages
path: packages
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: packages/*
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}