Skip to content

Commit 087c9ca

Browse files
authored
feat: release binaries (#843)
1 parent 75f4426 commit 087c9ca

File tree

10 files changed

+125
-14
lines changed

10 files changed

+125
-14
lines changed

.github/workflows/docker.yaml renamed to .github/workflows/build.yaml

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Docker
1+
name: Build
22

33
on:
44
push:
55
branches:
66
- master
77
tags:
8-
- 'v*'
8+
- "v*"
99
pull_request:
1010

1111
permissions: {}
@@ -15,6 +15,43 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
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

.github/workflows/docker-scan.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v4
3131
with:
3232
persist-credentials: false
33-
- uses: actions/setup-go@v5
33+
- uses: actions/setup-go@v6
3434
with:
3535
go-version-file: go.mod
3636
cache: false
@@ -69,7 +69,7 @@ jobs:
6969
- uses: actions/checkout@v4
7070
with:
7171
persist-credentials: false
72-
- uses: actions/setup-go@v5
72+
- uses: actions/setup-go@v6
7373
with:
7474
go-version-file: go.mod
7575
cache: false

.github/workflows/docker-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v4
3131
with:
3232
persist-credentials: false
33-
- uses: actions/setup-go@v5
33+
- uses: actions/setup-go@v6
3434
with:
3535
go-version-file: go.mod
3636
cache: false

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
25-
- uses: actions/setup-go@v5
25+
- uses: actions/setup-go@v6
2626
with:
2727
go-version-file: go.mod
2828
- run: go test -buildvcs ./...
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/checkout@v4
3737
with:
3838
persist-credentials: false
39-
- uses: actions/setup-go@v5
39+
- uses: actions/setup-go@v6
4040
with:
4141
go-version-file: go.mod
4242
- run: go tool goimports -l .
@@ -50,7 +50,7 @@ jobs:
5050
- uses: actions/checkout@v4
5151
with:
5252
persist-credentials: false
53-
- uses: actions/setup-go@v5
53+
- uses: actions/setup-go@v6
5454
with:
5555
go-version-file: go.mod
5656
- run: go mod tidy -diff
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/checkout@v4
6565
with:
6666
persist-credentials: false
67-
- uses: actions/setup-go@v5
67+
- uses: actions/setup-go@v6
6868
with:
6969
go-version-file: go.mod
7070
- uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
## 5.0.0 (2025-X-Y)
1+
## 5.0.1+
2+
3+
Please use the GitHub Releases page for future changelogs.
4+
They are automatically generated, meaning there is less work for us to do, and thus less error-prone.
5+
6+
## 5.0.0 (2025-10-31)
27

38
- Rewrite: Migrate to Go
49
- This also means the entire Node.js service and plugin are both gone.

cmd/sandbox/cmd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build linux
2+
13
package sandbox
24

35
import (

cmd/sandbox/cmd_nonlinux.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//go:build !linux
2+
3+
package sandbox
4+
5+
import (
6+
"context"
7+
"fmt"
8+
9+
"github.com/urfave/cli/v3"
10+
)
11+
12+
func NewCmd() *cli.Command {
13+
return &cli.Command{
14+
Name: "_internal_sandbox",
15+
SkipFlagParsing: true,
16+
Action: func(ctx context.Context, c *cli.Command) error {
17+
return fmt.Errorf("unsupported on your system")
18+
},
19+
}
20+
}

docs/troubleshooting.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ If you are a Grafana Enterprise customer, consider contacting Grafana Support.
136136
## My Grafana isn't in Docker
137137

138138
You can use [host networking](https://docs.docker.com/engine/network/tutorials/host/) instead.
139+
140+
## I use Windows and do not want Docker
141+
142+
You can download the Windows binaries from the GitHub Release.
143+
As an example, this is how you run it with Brave on an ARM64 Windows host:
144+
145+
```powershell
146+
PS > .\grafana-image-renderer-windows-arm64.exe server --browser.path "C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe"
147+
```
148+
149+
The browser must be installed separately.
150+
The browser must be a Chromium-based browser.

pkg/sandbox/sandbox.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build linux
2+
13
package sandbox
24

35
import (

pkg/sandbox/sandbox_nonlinux.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//go:build !linux
2+
3+
package sandbox
4+
5+
import "context"
6+
7+
// Supported attempts to determine if the current file-system will permit using our sandboxing.
8+
//
9+
// Upon any error, it returns false.
10+
func Supported(_ context.Context) bool {
11+
return false
12+
}

0 commit comments

Comments
 (0)