Skip to content

Commit 60cd01b

Browse files
authored
Actions: Include download URLs (#674)
1 parent 2410094 commit 60cd01b

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

.github/workflows/build-plugin.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,52 @@ jobs:
144144
GRAFANA_ACCESS_POLICY_TOKEN=gcom-token:token
145145
146146
- uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2
147+
id: release
147148
with:
148149
files: |
149150
artifacts/*.zip
150151
artifacts/md5sums.txt
151152
fail_on_unmatched_files: true
152153
make_latest: 'true'
153154
generate_release_notes: true
154-
- run: |
155+
- name: Add download URLs to gcom.json
156+
env:
157+
ASSETS: ${{ steps.release.outputs.assets }}
158+
run: |
159+
set -euo pipefail
160+
# ASSETS is a JSON array of objects: {name, browser_download_url}
161+
# We want to modify gcom.json to have a `$.download` field which has the structure:
162+
# {"existing-key-here": {"md5": "existing value from previous file", "url": "browser_download_url"}}
163+
# where the `name` is used to map from `plugin-linux-x64-glibc.zip` to `linux-amd64`, etc.
164+
jq --argjson assets "$ASSETS" '
165+
.download as $old
166+
| .download = (
167+
$assets
168+
| map(
169+
. as $a
170+
| (
171+
$a.name
172+
| sub("^plugin-"; "")
173+
| sub("-unknown"; "")
174+
| sub("-glibc"; "")
175+
| sub("win32"; "windows")
176+
| sub("x64"; "amd64")
177+
| sub(".zip$"; "")
178+
) as $key
179+
| { ($key): { md5: $old[$key], url: $a.browser_download_url } }
180+
)
181+
| add
182+
)
183+
' gcom.json > with-urls.json
184+
185+
- name: Publish to grafana.com
186+
run: |
155187
set -euo pipefail
156188
curl --silent --show-error \
157189
--header 'User-Agent: grafana-image-renderer:/plugins/publish' \
158190
--header 'Content-Type: application/json' \
159191
--header 'Authorization: Bearer '"$GRAFANA_ACCESS_POLICY_TOKEN" \
160192
--request POST \
161-
--data @gcom.json \
193+
--data @with-urls.json \
162194
--location \
163195
https://grafana.com/api/plugins

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## 4.0.1 & 4.0.2 (2025-07-22)
1+
## 4.0.1, 4.0.2 & 4.0.3 (2025-07-22)
22

3-
This release only touches the build process of the plugin, as v4.0.0 and v4.0.1 did not release on the plugin catalog.
3+
This release only touches the build process of the plugin, as v4.0.0, .1, and .2 did not release on the plugin catalog.
44
There is no difference from v4.0.0 for Docker users.
55

66
## 4.0.0 (2025-07-22)

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"url": "https://github.com/grafana/grafana-image-renderer/blob/master/LICENSE"
2525
}
2626
],
27-
"version": "4.0.2",
27+
"version": "4.0.3",
2828
"updated": "2025-07-22"
2929
},
3030
"dependencies": {

0 commit comments

Comments
 (0)