1010
1111permissions :
1212 packages : write
13+
14+ env :
15+ PADDLE_VERSION : " 3.0.0"
1316
1417jobs :
1518 build-all :
1619 runs-on : ubuntu-22.04
1720 strategy :
1821 matrix :
1922 include :
20- - { title: win64.mkl, rid: win-x64, url: https://github.com/sdcb/PaddleSharp/actions/runs/15327077635/artifacts/3222470493 }
21- - { title: win64.openblas, rid: win-x64, url: https://github.com/sdcb/PaddleSharp/actions/runs/15327077635/artifacts/3222365146 }
22- - { title: win64.openblas-noavx, rid: win-x64, url: https://github.com/sdcb/PaddleSharp/actions/runs/15327077635/artifacts/3222401095 }
23- # - { title: win64-cu118, rid: win-x64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/Windows/GPU/x86-64_cuda11.8_cudnn8.6.0_trt8.5.1.7_mkl_avx_vs2019/paddle_inference_c.zip }
24- # - { title: win64-cu126, rid: win-x64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/Windows/GPU/x86-64_cuda12.6_cudnn9.5.1_trt10.5.0.18_mkl_avx_vs2019/paddle_inference_c.zip }
25- - { title: linux64, rid: linux-x64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/Linux/CPU/gcc8.2_avx_mkl/paddle_inference_c.tgz }
26- # - { title: linux64-cu118, rid: linux-x64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/Linux/GPU/x86-64_gcc11.2_avx_mkl_cuda11.8_cudnn8.9.7-trt8.6.1.6/paddle_inference_c.tgz }
27- # - { title: linux64-cu126, rid: linux-x64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/Linux/GPU/x86-64_gcc11.2_avx_mkl_cuda12.6_cudnn9.5.1-trt10.5.0.18/paddle_inference_c.tgz }
28- # - { title: osx-x64, rid: osx-x64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/MacOS/x86-64_clang_avx_accelerate_blas/paddle_inference_c.tgz }
29- # - { title: osx-arm64, rid: osx-arm64, url: https://paddle-inference-lib.bj.bcebos.com/3.0.0/cxx_c/MacOS/m1_clang_noavx_accelerate_blas/paddle_inference_c.tgz }
23+ - { title: win64.mkl, rid: win-x64, action: paddle-windows-build.yml, artifact: c_mkldnn }
24+ - { title: win64.openblas, rid: win-x64, action: paddle-windows-build.yml, artifact: c_openblas }
25+ - { title: win64.openblas-noavx, rid: win-x64, action: paddle-windows-build.yml, artifact: c_openblas_noavx }
3026
3127 steps :
32- - name : Cache
33- id : cache-inference-lib
34- uses : actions/cache@v4
35- with :
36- path : paddle_inference_c
37- key : ${{ matrix.url }}
38-
39- - name : Download
40- if : steps.cache-inference-lib.outputs.cache-hit != 'true'
28+ - name : Download Artifacts
29+ env :
30+ GH_TOKEN : ${{ github.token }}
4131 run : |
42- wget -q -O archive_file.tmp ${{ matrix.url }}
32+ echo "Fetching latest successful ${{ matrix.action }} run of branch ${{ github.ref_name }}"
33+ RUN_ID=$(gh run list -R ${{ github.repository }} \
34+ --workflow=${{ matrix.action }} \
35+ --branch=${{ github.ref_name }} \
36+ --status=success --limit=1 \
37+ --json databaseId | jq -r '.[0].databaseId')
38+ echo "Run id = $RUN_ID"
39+
40+ echo "Download artifact ${{ matrix.artifact }}"
41+ gh run download -R ${{ github.repository }} "$RUN_ID" --name "$ART_NAME" --dir paddle_inference_c
4342
44- if [[ "${{ matrix.rid }}" == "win-x64" ]]; then
45- unzip -q archive_file.tmp -d paddle_inference_c
46- else
47- mkdir paddle_inference_c && tar -xzf archive_file.tmp -C paddle_inference_c
48- fi
49- rm archive_file.tmp
43+ echo "::group::Artifact tree"
44+ ls -lR paddle_inference_c
45+ echo "::endgroup::"
5046
5147 - name : Show Downloaded
5248 run : |
6662 ls -l nuget
6763
6864 - name : Build NuGet package
69- env :
70- VERSION : 3.0.0.${{ github.run_number }}
7165 run : |
7266 set -euo pipefail
7367
@@ -140,7 +134,7 @@ jobs:
140134 <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
141135 <metadata>
142136 <id>${PKG_ID}</id>
143- <version>${VERSION }</version>
137+ <version>${{ env.PADDLE_VERSION }}.${{ github.run_number } }</version>
144138 <title>${PKG_ID} native bindings</title>
145139 <authors>${AUTHOR}</authors>
146140 <requireLicenseAcceptance>true</requireLicenseAcceptance>
@@ -183,17 +177,15 @@ jobs:
183177 echo "::group::生成的 nupkg"
184178 ls -l "${{ github.workspace }}/nupkgs"
185179 echo "::endgroup::"
180+ echo NUPKG_PATH="${{ github.workspace }}/nupkgs/${PKG_ID}.${{ env.PADDLE_VERSION }}.${{ github.run_number }}.nupkg" >> $GITHUB_ENV
186181
187182 - name : Upload nupkg artifact
188183 uses : actions/upload-artifact@v4
189184 with :
190185 name : nuget-${{ matrix.rid }}
191- path : nupkgs/*.nupkg
186+ path : ${{ env.NUPKG_PATH }}
192187 if-no-files-found : error
193188
194189 - name : Push nupkg to Github Packages
195190 run : |
196- for f in ${{ github.workspace }}/nupkgs/*.nupkg
197- do
198- dotnet nuget push "$f" --source "https://nuget.pkg.github.com/${{ github.repository_owner }}" --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate
199- done
191+ dotnet nuget push ${{ env.NUPKG_PATH }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}" --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate
0 commit comments