mirror of
https://github.com/grafana/loki.git
synced 2026-03-13 09:33:58 +08:00
**What this PR does / why we need it**: Releases in GitHub are published automatically from Drone. Drone calls the `tools/release` script which uses the `tools/release-note.md` template to generate the release body. Before this PR, the template used the `$DRONE_TAG` env variable which had a `v` preffix (e. `v2.8.0`). Since we publish the docker images without the `v` preffix, the docker images referenced by the release did not exist. This affected the `v2.8.0`, `v2.8.1` and `v2.8.2` releases. I manually fixed the `v2.8.0`, `v2.8.1` and `v2.8.2` release pages, but this PR should fix the template so we no longer run into this situation. **Which issue(s) this PR fixes**: Fixes https://github.com/grafana/loki/issues/9384 **Special notes for your reviewer**: Not sure where to find the available env variables in Drone. I wonder if there is an existing env var with the version without the `v` preffix. **Checklist** - [ ] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [ ] Documentation added - [ ] Tests updated - [ ] `CHANGELOG.md` updated - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md`
13 lines
281 B
Bash
Executable File
13 lines
281 B
Bash
Executable File
#!/usr/bin/env bash
|
|
DRONE_TAG_NO_V=${DRONE_TAG#v}
|
|
export DRONE_TAG_NO_V
|
|
|
|
ghr \
|
|
-t "${GITHUB_TOKEN}" \
|
|
-u "${DRONE_REPO_OWNER}" \
|
|
-r "${DRONE_REPO_NAME}" \
|
|
-c "${DRONE_COMMIT}" \
|
|
-b="$(cat ./tools/release-note.md | envsubst)" \
|
|
-delete -draft \
|
|
"${DRONE_TAG}" ./dist/
|