14
14
env :
15
15
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
16
16
BUILD_TYPE : Release
17
+ CTEST_OUTPUT_ON_FAILURE : 1
18
+ CONAN_NON_INTERACTIVE : 1
17
19
18
20
jobs :
19
21
build :
@@ -39,28 +41,11 @@ jobs:
39
41
# uses: turtlebrowser/get-conan@4dc7e6dd45c8b1e02e909979d7cfc5ebba6ddbe2
40
42
uses : turtlebrowser/get-conan@v1.0
41
43
42
- - name : Conan profile and settings
43
- run : |
44
- conan profile new --detect default
45
- conan config set general.revisions_enabled=1
46
-
47
- - name : Conan profile (linux-workaround)
48
- if : matrix.os == 'ubuntu-latest'
49
- run :
50
- conan profile update settings.compiler.libcxx=libstdc++11 default
51
-
52
- - name : Conan install (osx-workaround)
53
- if : matrix.os == 'macos-latest'
54
- working-directory : ${{github.workspace}}/build
55
- run : |
56
- conan remote add ns1labs-conan https://ns1labs.jfrog.io/artifactory/api/conan/ns1labs-conan
57
- conan install --build=missing ..
58
-
59
44
- name : linux package install
60
45
if : matrix.os == 'ubuntu-latest'
61
46
run : |
62
47
sudo apt-get update
63
- sudo apt-get install --yes --no-install-recommends golang ca-certificates jq
48
+ sudo apt-get install --yes --no-install-recommends jq
64
49
65
50
- name : Configure CMake
66
51
# Use a bash shell so we can use the same syntax for environment variable
85
70
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
86
71
run : ctest -C $BUILD_TYPE
87
72
73
+ - name : Login to ns1labs conan
74
+ run : CONAN_USER_HOME=${{github.workspace}}/build/conan_home conan user -p ${{ secrets.CONAN_LABS_PASSWORD }} -r ns1labs ${{ secrets.CONAN_LABS_USERNAME }}
75
+
76
+ - name : Cache conan packages
77
+ run : CONAN_USER_HOME=${{github.workspace}}/build/conan_home conan upload "*" --all -r ns1labs -c
78
+
88
79
package :
89
80
needs : build
90
81
runs-on : ubuntu-latest
@@ -100,12 +91,6 @@ jobs:
100
91
- name : Get Conan
101
92
uses : turtlebrowser/get-conan@v1.0
102
93
103
- - name : Conan profile and settings
104
- run : |
105
- conan profile new --detect default
106
- conan config set general.revisions_enabled=1
107
- conan profile update settings.compiler.libcxx=libstdc++11 default
108
-
109
94
- name : Configure CMake to generate VERSION
110
95
shell : bash
111
96
working-directory : ${{github.workspace}}/build
@@ -152,8 +137,7 @@ jobs:
152
137
- name : Manage Github ref tags
153
138
uses : actions/github-script@v3
154
139
with :
155
- github-token : ${{ github.token }}
156
- # note deleteRef can't start with refs/, but create createRef does.
140
+ github-token : ${{ github.token }} # note deleteRef can't start with refs/, but create createRef does.
157
141
script : |
158
142
try {
159
143
await github.git.deleteRef({
@@ -184,6 +168,30 @@ jobs:
184
168
docker build . --file docker/Dockerfile --tag ${{ env.IMAGE_NAME }}:${{ env.VERSION }} --tag ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
185
169
docker push -a ${{ env.IMAGE_NAME }}
186
170
171
+ - name : Build + push - pktvisor-cli
172
+ env :
173
+ CLI_BINARY : pktvisor-cli
174
+ IMAGE_NAME : ns1labs/pktvisor-cli
175
+ run : |
176
+ docker build . --file docker/Dockerfile.pktvisor-cli --tag ${{ env.IMAGE_NAME }}:${{ env.VERSION }} --tag ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
177
+ docker push -a ${{ env.IMAGE_NAME }}
178
+ echo "CONT_ID=$(docker create --name ${{ env.CLI_BINARY }}-slim-tmp ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }})" >> $GITHUB_ENV
179
+
180
+ - name : Extract static pktvisor-cli asset
181
+ env :
182
+ CLI_BINARY : pktvisor-cli
183
+ IMAGE_NAME : ns1labs/pktvisor-cli
184
+ run : |
185
+ docker cp ${{ env.CONT_ID }}:/${{ env.CLI_BINARY }} ${{github.workspace}}/${{ env.CLI_BINARY }}-linux-x86_64-${{ env.VERSION }}
186
+
187
+ - name : Upload pktvisor-cli artifact
188
+ env :
189
+ BINARY_NAME : pktvisor-cli-linux-x86_64-${{ env.VERSION }}
190
+ uses : actions/upload-artifact@v2
191
+ with :
192
+ name : ${{ env.BINARY_NAME }}
193
+ path : ${{github.workspace}}/${{ env.BINARY_NAME }}
194
+
187
195
- name : Build + push - pktvisor-prom-write
188
196
env :
189
197
IMAGE_NAME : ns1labs/pktvisor-prom-write
0 commit comments