|
12 | 12 | jobs: |
13 | 13 | build-bundle: |
14 | 14 | runs-on: ubuntu-latest |
15 | | - env: |
16 | | - VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }} |
17 | 15 | steps: |
18 | 16 | - uses: actions/checkout@v4 |
19 | 17 | - uses: actions/setup-go@v5 |
20 | 18 | with: |
21 | 19 | 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" |
22 | 32 | - name: Clone k6-docs |
23 | 33 | run: git clone --depth 1 https://github.com/grafana/k6-docs.git /tmp/k6-docs |
24 | 34 | - 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 |
26 | 36 | - name: Compress bundle |
27 | 37 | 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 |
30 | 40 | - name: Publish release |
31 | 41 | uses: softprops/action-gh-release@v2 |
32 | 42 | 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