1414env :
1515 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1616 BUILD_TYPE : Release
17+ CTEST_OUTPUT_ON_FAILURE : 1
18+ CONAN_NON_INTERACTIVE : 1
1719
1820jobs :
1921 build :
@@ -39,28 +41,11 @@ jobs:
3941 # uses: turtlebrowser/get-conan@4dc7e6dd45c8b1e02e909979d7cfc5ebba6ddbe2
4042 uses : turtlebrowser/get-conan@v1.0
4143
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-
5944 - name : linux package install
6045 if : matrix.os == 'ubuntu-latest'
6146 run : |
6247 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
6449
6550 - name : Configure CMake
6651 # Use a bash shell so we can use the same syntax for environment variable
8570 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
8671 run : ctest -C $BUILD_TYPE
8772
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+
8879 package :
8980 needs : build
9081 runs-on : ubuntu-latest
@@ -100,12 +91,6 @@ jobs:
10091 - name : Get Conan
10192 uses : turtlebrowser/get-conan@v1.0
10293
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-
10994 - name : Configure CMake to generate VERSION
11095 shell : bash
11196 working-directory : ${{github.workspace}}/build
@@ -152,8 +137,7 @@ jobs:
152137 - name : Manage Github ref tags
153138 uses : actions/github-script@v3
154139 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.
157141 script : |
158142 try {
159143 await github.git.deleteRef({
@@ -184,6 +168,30 @@ jobs:
184168 docker build . --file docker/Dockerfile --tag ${{ env.IMAGE_NAME }}:${{ env.VERSION }} --tag ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
185169 docker push -a ${{ env.IMAGE_NAME }}
186170
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+
187195 - name : Build + push - pktvisor-prom-write
188196 env :
189197 IMAGE_NAME : ns1labs/pktvisor-prom-write
0 commit comments