Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 85 additions & 1 deletion .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ jobs:
name: Create GitHub Release
runs-on:
group: infra1-runners-arc
labels: runners-small
labels: runners-cxa-xlarge
needs: [ check-pr-labels, docker-build-and-publish, create-git-tag, extract-changelog ]
if: ${{ needs.check-pr-labels.outputs.skip_publish != 'true' }}
permissions:
Expand All @@ -337,6 +337,59 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "Creating GitHub release for version: ${VERSION}"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Cross-compile binaries for all platforms
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
mkdir -p dist

TARGETS=(
# Linux
"linux/amd64"
"linux/arm64"
# macOS
"darwin/amd64"
"darwin/arm64"
# Windows
"windows/amd64"
"windows/arm64"
)

for target in "${TARGETS[@]}"; do
IFS='/' read -r os arch <<< "$target"
ext=""
if [ "$os" = "windows" ]; then ext=".exe"; fi

name="goodmock-${os}-${arch}${ext}"
echo "Building ${os}/${arch}..."
CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -ldflags="-s -w" -o "dist/${name}" .

# Package: .zip for windows, .tar.gz for everything else
cd dist
if [ "$os" = "windows" ]; then
zip "${name%.exe}.zip" "$name"
rm "$name"
else
tar czf "${name}.tar.gz" "$name"
rm "$name"
fi
cd ..
done

# Generate SHA-256 hashes for all archives
cd dist
for file in *; do
sha256sum "$file" > "${file}.sha256"
done
cd ..

echo "Built $(ls dist/ | grep -cv '\.sha256$') packages with SHA-256 hashes:"
ls -lh dist/

- name: Create Release Body
id: release_body
env:
Expand Down Expand Up @@ -372,6 +425,34 @@ jobs:
docker run --rm gooddata/gooddata-goodmock:${VERSION} [command]
\`\`\`

## Standalone Binaries

Download the binary for your platform from the assets below.

| Platform | Architecture | Asset |
|----------|-------------|-------|
| Linux | x86_64 | \`goodmock-linux-amd64.tar.gz\` |
| Linux | ARM64 | \`goodmock-linux-arm64.tar.gz\` |
| macOS | Intel | \`goodmock-darwin-amd64.tar.gz\` |
| macOS | Apple Silicon | \`goodmock-darwin-arm64.tar.gz\` |
| Windows | x86_64 | \`goodmock-windows-amd64.zip\` |
| Windows | ARM64 | \`goodmock-windows-arm64.zip\` |

<details>
<summary>All platforms</summary>

$(ls dist/ | sort | sed 's/^/- `/' | sed 's/$/`/')
</details>

### Install (Linux/macOS)

\`\`\`bash
# Example: download and install linux/amd64
curl -sL https://github.com/${{ github.repository }}/releases/download/v${VERSION}/goodmock-linux-amd64.tar.gz | tar xz
chmod +x goodmock-linux-amd64
sudo mv goodmock-linux-amd64 /usr/local/bin/goodmock
\`\`\`

## Changelog

${CHANGELOG}
Expand All @@ -391,6 +472,7 @@ jobs:
tag: v${{ steps.version.outputs.VERSION }}
name: Release v${{ steps.version.outputs.VERSION }}
bodyFile: release_body.md
artifacts: "dist/*"
draft: false
prerelease: false
makeLatest: true
Expand All @@ -400,11 +482,13 @@ jobs:
- name: Release Summary
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
BINARY_COUNT=$(ls dist/ | wc -l)

echo "### 🎉 GitHub Release Created Successfully" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Release:** v${VERSION}" >> $GITHUB_STEP_SUMMARY
echo "**Tag:** v${VERSION}" >> $GITHUB_STEP_SUMMARY
echo "**Binaries:** ${BINARY_COUNT} platform packages attached" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Docker Image:** \`gooddata/gooddata-goodmock:${VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.0] - 2026-03-15

### Added
- Cross-platform binary releases attached to GitHub Releases (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, windows/arm64) with SHA-256 checksums

### Changed
- Binaries are now built with `-ldflags="-s -w"` to strip debug symbols and reduce binary size

## [0.7.0] - 2026-03-15

### Added
Expand Down Expand Up @@ -94,6 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release

[0.8.0]: https://github.com/gooddata/gooddata-goodmock/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/gooddata/gooddata-goodmock/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/gooddata/gooddata-goodmock/compare/v0.5.1...v0.6.0
[0.5.1]: https://github.com/gooddata/gooddata-goodmock/compare/v0.5.0...v0.5.1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN go mod download
COPY . .

# Build the Go application
RUN CGO_ENABLED=0 GOOS=linux go build -o goodmock .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o goodmock .

FROM scratch
WORKDIR /
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0