1- name : Docker
1+ name : Build
22
33on :
44 push :
55 branches :
66 - master
77 tags :
8- - ' v* '
8+ - " v* "
99 pull_request :
1010
1111permissions : {}
@@ -15,6 +15,43 @@ concurrency:
1515 cancel-in-progress : true
1616
1717jobs :
18+ go-build :
19+ strategy :
20+ matrix :
21+ include :
22+ - GOOS : linux
23+ GOARCH : amd64
24+ - GOOS : linux
25+ GOARCH : arm64
26+ - GOOS : windows
27+ GOARCH : amd64
28+ SUFFIX : .exe
29+ - GOOS : windows
30+ GOARCH : arm64
31+ SUFFIX : .exe
32+ fail-fast : false
33+
34+ name : Go build (for ${{ matrix.GOOS }}/${{ matrix.GOARCH }})
35+ runs-on : ubuntu-latest
36+ env :
37+ GOOS : ${{ matrix.GOOS }}
38+ GOARCH : ${{ matrix.GOARCH }}
39+ SUFFIX : ${{ matrix.SUFFIX || '' }}
40+ steps :
41+ - uses : actions/checkout@v4
42+ with :
43+ persist-credentials : false
44+ - uses : actions/setup-go@v6
45+ with :
46+ go-version-file : go.mod
47+ cache : false
48+ - name : go build
49+ run : go build -o grafana-image-renderer-"$GOOS"-"$GOARCH""$SUFFIX" -buildvcs -ldflags '-s -w' .
50+ - uses : actions/upload-artifact@v4
51+ with :
52+ name : grafana-image-renderer-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.SUFFIX || '' }}
53+ path : grafana-image-renderer-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.SUFFIX || '' }}
54+
1855 tag :
1956 name : Create image tag
2057 runs-on : ubuntu-latest
@@ -176,11 +213,32 @@ jobs:
176213 > This is a development image and should not be used in production.
177214 > It will be automatically removed after 2 weeks.
178215
179- # Workflow: https://argo-workflows.grafana.net/workflow-templates/render-service-cd/auto-deploy-dev
216+ release :
217+ name : Create GitHub Release
218+ if : github.event_name == 'push' && github.ref_type == 'tag'
219+ needs : [tag, build, manifest, go-build]
220+ runs-on : ubuntu-latest
221+ permissions :
222+ contents : write # to create the release
223+ packages : read # to read the package information
224+ steps :
225+ - uses : actions/download-artifact@v4
226+ with :
227+ merge-multiple : true
228+ path : bins/
229+ pattern : grafana-image-renderer-*
230+ - uses : softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2
231+ with :
232+ files : bins/*
233+ fail_on_unmatched_files : true
234+ make_latest : " true"
235+ generate_release_notes : true
236+
237+ # Workflow: https://argo-workflows.grafana.net/workflow-templates/render-service-cd/auto-deploy-dev
180238 cd-auto-deploy-dev :
181239 name : Deploy to dev
182240 if : startsWith(github.ref, 'refs/tags/v')
183- needs : [tag, build ]
241+ needs : [tag, manifest ]
184242 runs-on : ubuntu-latest
185243 permissions :
186244 contents : read
@@ -199,11 +257,11 @@ jobs:
199257 run : |
200258 echo "URI: ${{ steps.trigger-argowfs-deployment.outputs.uri }}"
201259
202- # Workflow: https://argo-workflows.grafana.net/workflow-templates/render-service-cd/deploy-prod
260+ # Workflow: https://argo-workflows.grafana.net/workflow-templates/render-service-cd/deploy-prod
203261 cd-deploy-prod :
204262 name : Deploy to prod
205263 if : startsWith(github.ref, 'refs/tags/v')
206- needs : [tag, build ]
264+ needs : [tag, manifest ]
207265 runs-on : ubuntu-latest
208266 permissions :
209267 contents : read
0 commit comments