|
30 | 30 | path: ${{ env.WORKSPACE_SRC_PATH }} |
31 | 31 |
|
32 | 32 | - name: Build and install |
| 33 | + id: build-and-install |
33 | 34 | shell: bash |
34 | 35 | run: | |
35 | 36 | if [[ "$RUNNER_OS" == "Windows" ]]; then |
@@ -71,17 +72,42 @@ jobs: |
71 | 72 | echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT |
72 | 73 |
|
73 | 74 | - name: Create artifact |
| 75 | + id: create-artifact |
74 | 76 | uses: actions/upload-artifact@v4.4.0 |
75 | 77 | with: |
76 | 78 | name: ${{ steps.sanitize.outputs.artifact_name }} |
77 | 79 | path: ${{ env.WORKSPACE_INSTALL_PATH }} |
78 | 80 |
|
79 | 81 | - name: Install artifact |
| 82 | + id: install-artifact |
80 | 83 | uses: actions/download-artifact@v4.1.7 |
81 | 84 | with: |
82 | 85 | name: ${{ steps.sanitize.outputs.artifact_name }} |
83 | 86 | path: ${{ env.WORKSPACE_ARTIFACT_PATH }} |
84 | 87 |
|
| 88 | + - name: Notify dashboard |
| 89 | + if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master |
| 90 | + env: |
| 91 | + DASH_AUTH: ${{ secrets.PLUGIN_DASH }} |
| 92 | + shell: bash |
| 93 | + run: | |
| 94 | + build_status=$([ '${{ steps.build-and-install.outcome }}' == 'success' ] && \ |
| 95 | + echo 'true' || echo 'false') |
| 96 | +
|
| 97 | + binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \ |
| 98 | + [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \ |
| 99 | + [ '${{ steps.sanitize.outcome }}' == 'success' ] && \ |
| 100 | + echo 'true' || echo 'false') |
| 101 | +
|
| 102 | +
|
| 103 | + curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \ |
| 104 | + "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\ |
| 105 | + \"github_ref\":\"${{ github.sha }}\",\ |
| 106 | + \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\ |
| 107 | + \"build\":\"$build_status\",\ |
| 108 | + \"binary\":\"$binary_status\"}"\ |
| 109 | + https://sofa-framework.org:5000/api/v1/plugins |
| 110 | +
|
85 | 111 | deploy: |
86 | 112 | name: Deploy artifacts |
87 | 113 | if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR) |
|
0 commit comments