Skip to content

Commit 9590d84

Browse files
committed
fix(ci): add release build and GitHub release steps back to main pipeline
PR #79 split the pipeline into validation-only (pipeline.yml) and a separate release pipeline (pipeline.release.yml), but the release pipeline was never wired in Buildkite. Merging to main created a tag but no binary or GitHub release. Fix: restore release_build (binary + sha256) and GitHub release steps after the tag step in pipeline.yml, so a single run produces both the tag and the release. The release pipeline remains available as a standalone option for manually pushed tags. Also merges build+checksum into one step in pipeline.release.yml to match the same-agent optimization done in pipeline.yml.
1 parent 9aa4cdd commit 9590d84

3 files changed

Lines changed: 40 additions & 24 deletions

File tree

.buildkite/pipeline.release.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,20 @@
44
cache: ".buildkite/cache-volume"
55

66
steps:
7-
- label: ":golang: Build Release Binary"
7+
- label: ":golang: Build + Checksum"
88
key: build
99
command: |
1010
echo "--- Building release binary for ${BUILDKITE_TAG}"
1111
.buildkite/setup-go.sh go build \
1212
-ldflags="-s -w -X main.version=${BUILDKITE_TAG}" \
1313
-o builddeck ./cmd/builddeck
1414
echo "+++ Binary size: $(ls -lh builddeck | awk '{print $5}')"
15-
buildkite-agent artifact upload builddeck
16-
17-
- label: ":lock: Checksum"
18-
key: checksum
19-
depends_on: build
20-
command: |
21-
echo "--- Generating SHA256 checksum"
22-
buildkite-agent artifact download builddeck .
2315
sha256sum builddeck | tee builddeck.sha256
24-
buildkite-agent artifact upload builddeck.sha256
16+
buildkite-agent artifact upload "builddeck*"
2517
2618
- label: ":rocket: GitHub Release"
2719
key: release
28-
depends_on: checksum
20+
depends_on: build
2921
command: .buildkite/release.sh "${BUILDKITE_TAG}"
3022
secrets:
3123
- GITHUB_TOKEN

.buildkite/pipeline.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ steps:
5959
chmod +x codecov
6060
./codecov -f coverage.out
6161
62-
- label: ":terminal: Snapshot Build"
62+
- label: ":terminal: Snapshot + Checksum"
6363
key: snapshot
6464
depends_on:
6565
- vet
@@ -70,24 +70,50 @@ steps:
7070
echo "--- Building snapshot binary"
7171
.buildkite/setup-go.sh go build -ldflags="-s -w -X main.version=snapshot-${BUILDKITE_COMMIT:0:7}" -o builddeck ./cmd/builddeck
7272
echo "+++ Snapshot build succeeded: $(ls -lh builddeck | awk '{print $5}')"
73-
buildkite-agent artifact upload builddeck
74-
75-
- label: ":lock: Checksum"
76-
key: checksum
77-
depends_on: snapshot
78-
command: |
7973
sha256sum builddeck | tee builddeck.sha256
80-
buildkite-agent artifact upload builddeck.sha256
74+
buildkite-agent artifact upload "builddeck*"
8175
8276
- label: ":bookmark: Tag"
8377
key: tag
8478
depends_on:
8579
- commitlint
8680
- test
87-
- checksum
81+
- snapshot
8882
- codecov
8983
branches: main
9084
command: |
9185
.buildkite/tag.sh
9286
secrets:
9387
- GITHUB_TOKEN
88+
89+
- label: ":golang: Build Release Binary"
90+
key: release_build
91+
depends_on: tag
92+
command: |
93+
echo "--- Checking for release version from tag step"
94+
if buildkite-agent artifact download builddeck.tag . --step tag 2>/dev/null; then
95+
VERSION=$(cat builddeck.tag)
96+
echo "Version from tag step: ${VERSION}"
97+
else
98+
VERSION="dev"
99+
echo "No tag created, building with version: ${VERSION}"
100+
fi
101+
echo "--- Building release binary"
102+
.buildkite/setup-go.sh go build -ldflags="-s -w -X main.version=${VERSION}" -o builddeck ./cmd/builddeck
103+
echo "+++ Binary size: $(ls -lh builddeck | awk '{print $5}')"
104+
sha256sum builddeck | tee builddeck.sha256
105+
buildkite-agent artifact upload "builddeck*"
106+
107+
- label: ":rocket: GitHub Release"
108+
key: release
109+
depends_on: release_build
110+
command: |
111+
if buildkite-agent artifact download builddeck.tag . --step tag 2>/dev/null; then
112+
VERSION=$(cat builddeck.tag)
113+
echo "Creating GitHub release for ${VERSION}"
114+
.buildkite/release.sh "${VERSION}"
115+
else
116+
echo "No tag was created — skipping GitHub release"
117+
fi
118+
secrets:
119+
- GITHUB_TOKEN

.buildkite/release.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
# Creates a GitHub Release linked to git tag with all artifacts and generated notes.
3-
# Runs in the release pipeline after tag push.
3+
# Expects builddeck and builddeck.sha256 in the current directory (same-agent
4+
# after release_build step or tag-push triggered pipeline).
45
# Usage: release.sh <version>
56
set -euo pipefail
67

@@ -14,9 +15,6 @@ echo "+++ Creating GitHub Release ${VERSION}"
1415

1516
cd "$(dirname "$0")/.."
1617

17-
buildkite-agent artifact download "builddeck" . --step build 2>/dev/null || true
18-
buildkite-agent artifact download "builddeck.sha256" . --step checksum 2>/dev/null || true
19-
2018
echo "=== Files in workspace ==="
2119
ls -la
2220

0 commit comments

Comments
 (0)