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
27 changes: 27 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"packages": {
".": {
"release-type": "simple",
"changelog-path": "CHANGELOG.md",
"extra-files": [
{
"type": "generic",
"path": "MODULE.bazel"
}
]
}
},
"changelog-sections": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "perf", "section": "Performance Improvements"},
{"type": "revert", "section": "Reverts"},
{"type": "docs", "section": "Documentation"},
{"type": "style", "section": "Styles", "hidden": true},
{"type": "chore", "section": "Miscellaneous", "hidden": true},
{"type": "refactor", "section": "Code Refactoring", "hidden": true},
{"type": "test", "section": "Tests", "hidden": true},
{"type": "build", "section": "Build System", "hidden": true},
{"type": "ci", "section": "CI/CD", "hidden": true}
]
}
File renamed without changes.
127 changes: 127 additions & 0 deletions .github/workflows/bazel-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Bazel CI

on:
workflow_call:
inputs:
run-tests:
description: Run bazel test //...
type: boolean
default: false
run-build:
description: Run bazel build //cmd/zuul-mcp
type: boolean
default: false
publish-platforms:
description: JSON array of platforms to build for release
type: string
default: ''
tag-name:
description: Release tag name (required for publish)
type: string
default: ''
outputs:
artifact-name:
description: Name of the uploaded artifact containing binaries
value: ${{ jobs.collect.outputs.artifact-name }}

jobs:
test:
name: Test
if: inputs.run-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: bazel-${{ github.ref_name }}-${{ hashFiles('MODULE.bazel.lock') }}
repository-cache: true

- name: Run tests
run: bazel test //... --config=ci

build:
name: Build
if: inputs.run-build
needs: [test]
# Run even if test was skipped (when run-tests is false)
# But fail if test actually failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: bazel-${{ github.ref_name }}-${{ hashFiles('MODULE.bazel.lock') }}
repository-cache: true

- name: Build
run: bazel build //cmd/zuul-mcp --config=ci

publish:
name: Build ${{ matrix.platform.config }}
if: inputs.publish-platforms != ''
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(inputs.publish-platforms) }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: bazel-${{ github.ref_name }}-${{ hashFiles('MODULE.bazel.lock') }}
repository-cache: true

- name: Build binary
run: |
bazel build //cmd/zuul-mcp --config=${{ matrix.platform.config }} --config=ci --config=release
mkdir -p dist
cp bazel-bin/cmd/zuul-mcp/zuul-mcp_/zuul-mcp${{ matrix.platform.ext }} dist/${{ matrix.platform.output }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.platform.config }}
path: dist/
retention-days: 1

collect:
name: Collect Binaries
if: inputs.publish-platforms != ''
needs: [publish]
runs-on: ubuntu-latest
outputs:
artifact-name: dist-${{ inputs.tag-name }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: binary-*
path: dist
merge-multiple: true

- name: Create checksums
run: |
cd dist
sha256sum * > checksums.txt
echo "Contents of dist:"
ls -la
echo "Checksums:"
cat checksums.txt

- name: Upload combined artifact
uses: actions/upload-artifact@v4
with:
name: dist-${{ inputs.tag-name }}
path: dist/
retention-days: 5
113 changes: 32 additions & 81 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,30 @@ name: Release
on:
push:
branches: [main]
workflow_dispatch:
inputs:
dry-run:
description: Run CI only, skip release-please and publish
type: boolean
default: false

permissions:
contents: write
pull-requests: write

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Run tests
run: bazel test //... --config=ci

build:
name: Build
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Build
run: bazel build //cmd/zuul-mcp --config=ci
ci:
name: CI
uses: ./.github/workflows/bazel-ci.yaml
with:
run-tests: true
run-build: true

release-please:
name: Release Please
runs-on: ubuntu-latest
needs: [build]
needs: [ci]
if: ${{ !inputs.dry-run }}
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
Expand All @@ -59,63 +40,33 @@ jobs:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
token: ${{ steps.app-token.outputs.token }}

publish:
name: Publish Binaries
runs-on: ubuntu-latest
name: Publish
needs: [release-please]
if: needs.release-please.outputs.release_created == 'true'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
uses: ./.github/workflows/bazel-ci.yaml
with:
publish-platforms: '[{"config":"linux_amd64","output":"zuul-mcp-linux-amd64","ext":""},{"config":"linux_arm64","output":"zuul-mcp-linux-arm64","ext":""},{"config":"darwin_amd64","output":"zuul-mcp-darwin-amd64","ext":""},{"config":"darwin_arm64","output":"zuul-mcp-darwin-arm64","ext":""},{"config":"windows_amd64","output":"zuul-mcp-windows-amd64.exe","ext":".exe"}]'
tag-name: ${{ needs.release-please.outputs.tag_name }}

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
upload-release:
name: Upload to Release
runs-on: ubuntu-latest
needs: [release-please, publish]
if: needs.release-please.outputs.release_created == 'true'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Build binaries
run: |
mkdir -p dist

# Linux amd64 (static binary)
bazel build //cmd/zuul-mcp --config=linux_amd64 --config=ci --config=release
cp bazel-bin/cmd/zuul-mcp/zuul-mcp_/zuul-mcp dist/zuul-mcp-linux-amd64

# Linux arm64 (static binary)
bazel build //cmd/zuul-mcp --config=linux_arm64 --config=ci --config=release
cp bazel-bin/cmd/zuul-mcp/zuul-mcp_/zuul-mcp dist/zuul-mcp-linux-arm64

# macOS amd64
bazel build //cmd/zuul-mcp --config=darwin_amd64 --config=ci --config=release
cp bazel-bin/cmd/zuul-mcp/zuul-mcp_/zuul-mcp dist/zuul-mcp-darwin-amd64

# macOS arm64 (Apple Silicon)
bazel build //cmd/zuul-mcp --config=darwin_arm64 --config=ci --config=release
cp bazel-bin/cmd/zuul-mcp/zuul-mcp_/zuul-mcp dist/zuul-mcp-darwin-arm64

# Windows amd64
bazel build //cmd/zuul-mcp --config=windows_amd64 --config=ci --config=release
cp bazel-bin/cmd/zuul-mcp/zuul-mcp_/zuul-mcp.exe dist/zuul-mcp-windows-amd64.exe

# Create checksums
cd dist
sha256sum * > checksums.txt
name: dist-${{ needs.release-please.outputs.tag_name }}
path: dist

- name: Upload binaries to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: |
dist/zuul-mcp-linux-amd64
dist/zuul-mcp-linux-arm64
dist/zuul-mcp-darwin-amd64
dist/zuul-mcp-darwin-arm64
dist/zuul-mcp-windows-amd64.exe
dist/checksums.txt
files: dist/*
40 changes: 7 additions & 33 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Run tests
run: bazel test //... --config=ci

build:
name: Build
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Build
run: bazel build //cmd/zuul-mcp --config=ci
ci:
name: CI
uses: ./.github/workflows/bazel-ci.yaml
with:
run-tests: true
run-build: true

gazelle:
name: Gazelle
Expand All @@ -60,7 +34,7 @@ jobs:
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
disk-cache: bazel-${{ github.ref_name }}-${{ hashFiles('MODULE.bazel.lock') }}
repository-cache: true

- name: Check BUILD files are up to date
Expand Down
15 changes: 0 additions & 15 deletions .release-please-config.json

This file was deleted.

2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module(
name = "zuul_mcp",
version = "0.1.0",
version = "0.2.0", # x-release-please-version
)

# Platform definitions for cross-compilation
Expand Down
Loading