Skip to content

Commit d2436ad

Browse files
committed
fix: normalize version to wildcard in release workflow
The runtime cache expects wildcard versions (v1.6.x) in download URLs, but the workflow was tagging releases with exact versions (v1.6.1). Now the workflow maps v1.6.1 → v1.6.x before tagging and naming the artifact.
1 parent 73519be commit d2436ad

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

.github/workflows/release-bundle.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,35 @@ on:
1212
jobs:
1313
build-bundle:
1414
runs-on: ubuntu-latest
15-
env:
16-
VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }}
1715
steps:
1816
- uses: actions/checkout@v4
1917
- uses: actions/setup-go@v5
2018
with:
2119
go-version-file: go.mod
20+
- name: Resolve version
21+
id: version
22+
run: |
23+
RAW="${{ github.event.client_payload.version || github.event.inputs.version }}"
24+
# Ensure v prefix
25+
RAW="${RAW#v}"
26+
RAW="v${RAW}"
27+
# Map to wildcard: v1.6.1 → v1.6.x
28+
WILDCARD=$(echo "$RAW" | sed 's/\.[0-9]*$/\.x/')
29+
echo "exact=$RAW" >> "$GITHUB_OUTPUT"
30+
echo "wildcard=$WILDCARD" >> "$GITHUB_OUTPUT"
31+
echo "Exact: $RAW → Wildcard: $WILDCARD"
2232
- name: Clone k6-docs
2333
run: git clone --depth 1 https://github.com/grafana/k6-docs.git /tmp/k6-docs
2434
- name: Prepare docs
25-
run: go run ./cmd/prepare --k6-version=${{ env.VERSION }} --k6-docs-path=/tmp/k6-docs --output-dir=dist
35+
run: go run ./cmd/prepare --k6-version=${{ steps.version.outputs.exact }} --k6-docs-path=/tmp/k6-docs --output-dir=dist
2636
- name: Compress bundle
2737
run: |
28-
apt-get update && apt-get install -y zstd
29-
tar -cf - -C dist . | zstd --ultra -22 -o docs-${{ env.VERSION }}.tar.zst
38+
sudo apt-get update && sudo apt-get install -y zstd
39+
tar -cf - -C dist . | zstd --ultra -22 -o docs-${{ steps.version.outputs.wildcard }}.tar.zst
3040
- name: Publish release
3141
uses: softprops/action-gh-release@v2
3242
with:
33-
tag_name: docs-${{ env.VERSION }}
34-
name: "Docs bundle for k6 ${{ env.VERSION }}"
35-
files: docs-${{ env.VERSION }}.tar.zst
36-
body: "Auto-generated documentation bundle for k6 ${{ env.VERSION }}"
43+
tag_name: docs-${{ steps.version.outputs.wildcard }}
44+
name: "Docs bundle for k6 ${{ steps.version.outputs.wildcard }}"
45+
files: docs-${{ steps.version.outputs.wildcard }}.tar.zst
46+
body: "Auto-generated documentation bundle for k6 ${{ steps.version.outputs.exact }}"

0 commit comments

Comments
 (0)