31
31
path : ${{ env.WORKSPACE_SRC_PATH }}
32
32
33
33
- name : Build and install
34
+ id : build-and-install
34
35
shell : bash
35
36
run : |
36
37
if [[ "$RUNNER_OS" == "Windows" ]]; then
@@ -72,12 +73,14 @@ jobs:
72
73
echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT
73
74
74
75
- name : Create artifact
76
+ id : create-artifact
75
77
76
78
with :
77
79
name : ${{ steps.sanitize.outputs.artifact_name }}
78
80
path : ${{ env.WORKSPACE_INSTALL_PATH }}
79
81
80
82
- name : Install artifact
83
+ id : install-artifact
81
84
82
85
with :
83
86
name : ${{ steps.sanitize.outputs.artifact_name }}
@@ -99,6 +102,29 @@ jobs:
99
102
echo '----------------------'
100
103
python -c "import sys; print('sys.version = ' + str(sys.version)); print('sys.path = ' + str(sys.path))"
101
104
105
+ - name : Notify dashboard
106
+ if : always() && startsWith(github.repository, 'SofaDefrost') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master
107
+ env :
108
+ DASH_AUTH : ${{ secrets.PLUGIN_DASH }}
109
+ shell : bash
110
+ run : |
111
+ build_status=$([ '${{ steps.build-and-install.outcome }}' == 'success' ] && \
112
+ echo 'true' || echo 'false')
113
+
114
+ binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \
115
+ [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \
116
+ [ '${{ steps.sanitize.outcome }}' == 'success' ] && \
117
+ echo 'true' || echo 'false')
118
+
119
+
120
+ curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \
121
+ "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\
122
+ \"github_ref\":\"${{ github.sha }}\",\
123
+ \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\
124
+ \"build\":$build_status,\
125
+ \"binary\":$binary_status}"\
126
+ https://sofa-framework.org:5000/api/v1/plugins
127
+
102
128
deploy :
103
129
name : Deploy artifacts
104
130
if : always() && startsWith(github.repository, 'SofaDefrost') && (startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/')) # we are not on a fork and on a branch or a tag (not a PR)
0 commit comments