Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
d68e564
feat(azure.ai.evaluations): scaffold the Foundry evaluations extension
m7md7sien Jul 28, 2026
a960726
feat(azure.ai.evaluations): port the eval and dataset data-plane clients
m7md7sien Jul 28, 2026
2a8dbed
feat(azure.ai.evaluations): config model, client context, and dataset…
m7md7sien Jul 28, 2026
125cd7a
feat(azure.ai.evaluations): eval group builder and run command
m7md7sien Jul 28, 2026
035f6bb
feat(azure.ai.evaluations): evaluator and results commands
m7md7sien Jul 28, 2026
4f8a4eb
feat(azure.ai.evaluations): offline init command with round-trip tests
m7md7sien Jul 28, 2026
6b576e3
feat(azure.ai.evaluations): service-target provider with change detec…
m7md7sien Jul 28, 2026
065e84f
feat(azure.ai.evaluations): generate command with YAML write-back
m7md7sien Jul 28, 2026
38fb856
build(azure.ai.evaluations): release pipeline and foundry bundle entry
m7md7sien Jul 28, 2026
3b9cb93
fix(azure.ai.evaluations): bind dataset URIs and add live integration…
m7md7sien Jul 28, 2026
b7aba9d
fix(azure.ai.evaluations): build data mappings from each evaluator's …
m7md7sien Jul 28, 2026
4d26558
build(azure.ai.evaluations): add the build scripts the extension kit …
m7md7sien Jul 28, 2026
f92e69b
fix(azure.ai.evaluations): read the evaluator kind the listing actual…
m7md7sien Jul 28, 2026
5a670ca
fix(azure.ai.evaluations): make azd deploy work end to end
m7md7sien Jul 28, 2026
d21bbd3
fix(azure.ai.evaluations): resolve $ref includes in the service entry
m7md7sien Jul 28, 2026
ae6f43c
fix(azure.ai.evaluations): recreate an eval group when its own declar…
m7md7sien Jul 28, 2026
e71fc44
fix(azure.ai.evaluations): keep HTTP traces out of normal output
m7md7sien Jul 28, 2026
02e9e95
feat(azure.ai.evaluations): explain why agent-seeded data generation …
m7md7sien Jul 28, 2026
a049fa6
feat(azure.ai.evaluations): complete the atomic run operations
m7md7sien Jul 28, 2026
1ccb6d9
feat(azure.ai.evaluations): add run start to complete the atomic surface
m7md7sien Jul 28, 2026
4580224
fix(azure.ai.evaluations): make the dataset and evaluator write paths…
m7md7sien Jul 28, 2026
331d3fe
fix(azure.ai.evaluations): support custom evaluators in a deployed co…
m7md7sien Jul 28, 2026
4d1f827
fix(azure.ai.evaluations): honour --dataset when it names a registere…
m7md7sien Jul 28, 2026
9e2797f
fix(azure.ai.evaluations): survive the eventually consistent version …
m7md7sien Jul 28, 2026
2606b68
build(azure.ai.evaluations): add the CI scripts the release pipeline …
m7md7sien Jul 28, 2026
288927f
fix(azure.ai.evaluations): make the manifest and the binary agree
m7md7sien Jul 28, 2026
909ce14
feat(azure.ai.evaluations): detect artifact drift and read the instru…
m7md7sien Jul 28, 2026
800834e
fix(azure.ai.evaluations): make --eval-id work and catch unregistered…
m7md7sien Jul 28, 2026
d09111e
fix(azure.ai.evaluations): rebase a supplied dataset path onto the de…
m7md7sien Jul 28, 2026
ce2ce3a
feat(azure.ai.evaluations): say when a trace setting is being ignored
m7md7sien Jul 28, 2026
b10f706
fix(azure.ai.evaluations): honour the config fields that were being d…
m7md7sien Jul 28, 2026
2a101c0
build(azure.ai.evaluations): ignore the artifacts the tooling produces
m7md7sien Jul 28, 2026
7f1b067
fix(azure.ai.evaluations): make the persistence warnings useful
m7md7sien Jul 28, 2026
5853089
feat(azure.ai.evaluations): compare runs against a baseline
m7md7sien Jul 28, 2026
63a7a33
fix(azure.ai.evaluations): finish the generate step of the documented…
m7md7sien Jul 28, 2026
b122b0f
fix(azure.ai.evaluations): seed generation from the agent, not from a…
m7md7sien Jul 28, 2026
b9a3078
feat(azure.ai.evaluations): run an eval group on a schedule
m7md7sien Jul 28, 2026
1c42efa
feat(azure.ai.evaluations): evaluate an agent's traces, and say why a…
m7md7sien Jul 28, 2026
03c7026
fix(azure.ai.evaluations): send the trace window in the field the ser…
m7md7sien Jul 28, 2026
7905c97
feat(azure.ai.evaluations): evaluate stored responses by id
m7md7sien Jul 28, 2026
1d195f5
feat(azure.ai.evaluations): evaluate a model deployment directly
m7md7sien Jul 28, 2026
fbf532f
fix(azure.ai.evaluations): run the datasets that are already registered
m7md7sien Jul 28, 2026
09b7e5f
fix(azure.ai.evaluations): stop a second eval group from taking the f…
m7md7sien Jul 28, 2026
d961d3b
feat(azure.ai.evaluations): reach a group by name, and remember its r…
m7md7sien Jul 28, 2026
ca09620
fix(azure.ai.evaluations): publish the dataset version the config dec…
m7md7sien Jul 28, 2026
131f172
fix(azure.ai.evaluations): refuse an evaluator version the service wi…
m7md7sien Jul 28, 2026
1c42eb2
fix(azure.ai.evaluations): read the built-in evaluators' published sc…
m7md7sien Jul 28, 2026
ed62aee
test(azure.ai.evaluations): cover the lookup that supplies evaluator …
m7md7sien Jul 28, 2026
36b51c9
test(azure.ai.evaluations): pin the decisions that fail quietly
m7md7sien Jul 28, 2026
b28dfaa
Honour a hand-set EVAL_GROUP_ID again for single-group configs
m7md7sien Jul 28, 2026
69a6ec8
Emit a JSON array from every list command
m7md7sien Jul 28, 2026
ab06f36
Accept --eval-id on every command that takes an eval group
m7md7sien Jul 28, 2026
3a2fb1e
Survive the quoted NaN the service sends for an undefined statistic
m7md7sien Jul 28, 2026
fe590ed
Explain the two schedule failures the E2E scenarios turned up
m7md7sien Jul 28, 2026
42f8fe1
Declare the eval service in the root azure.yaml instead of describing it
m7md7sien Jul 28, 2026
2713a8e
Add the eval service through azd, and catch two things the corner cas…
m7md7sien Jul 28, 2026
f3a8ace
Order the eval service after the Foundry project when the repo declar…
m7md7sien Jul 28, 2026
cfe1140
Address review: drop "eval group", split the model flags, show output…
m7md7sien Jul 28, 2026
69335b5
Drop agent.context.tools, and the dataset update synonym
m7md7sien Jul 28, 2026
da39cb8
Finish the eval-group rename in user-facing strings, and add run list…
m7md7sien Jul 29, 2026
c919ed6
Add custom code evaluators
m7md7sien Jul 29, 2026
41d1f8b
Fix code evaluator publishing against the live service
m7md7sien Jul 29, 2026
32b01ba
Publish code evaluators as a single script, not a folder
m7md7sien Jul 30, 2026
53c08cb
Cover schedules end to end, and explain the role they need
m7md7sien Aug 2, 2026
423035b
Move scheduling out of M1 onto its own branch
m7md7sien Aug 2, 2026
e8c1f0c
Correct two stale claims in the command reference
m7md7sien Aug 2, 2026
b0879e4
Drive the CLI as a subprocess, and fix what that found
m7md7sien Aug 2, 2026
45a1cd1
Record the azd up gap for code evaluators as a TODO
m7md7sien Aug 2, 2026
488317b
Let azd up configure a code evaluator, and stop TestLiveRun skipping
m7md7sien Aug 2, 2026
f9bb2b0
Cancel runs through the OpenAI-spec route
m7md7sien Aug 2, 2026
042ae63
Cover the remaining commands with end-to-end CLI tests
m7md7sien Aug 2, 2026
d98d5c5
Record the publish-to-reference consistency lag
m7md7sien Aug 3, 2026
5d6663a
Take code evaluators and comparison out of M1
m7md7sien Aug 3, 2026
34f9c0c
Leave M1 with the one target it ships
m7md7sien Aug 3, 2026
4bbcd92
Give datasets the same surface as evaluators
m7md7sien Aug 3, 2026
f7ae563
Add the eval and job groups
m7md7sien Aug 3, 2026
975e1a5
Turn results into run output, and make run a group
m7md7sien Aug 3, 2026
6dc1594
Split generation per artifact, and add CI gating
m7md7sien Aug 3, 2026
4199cd2
Match the gate wording the scenario documents
m7md7sien Aug 3, 2026
a367176
Ask the direct read whether an evaluator exists
m7md7sien Aug 3, 2026
6023995
One service per eval: restructure the configuration model
m7md7sien Aug 3, 2026
0aa5ec5
Refuse a wrong flag before a missing one
m7md7sien Aug 3, 2026
9bf1505
Drive the hero scenarios through real azd
m7md7sien Aug 3, 2026
e24dc74
Pin the command surface, and fix the flag it caught
m7md7sien Aug 3, 2026
8dd23d0
Stop pointing users at a command that was renamed away
m7md7sien Aug 3, 2026
c176044
Note the platforms nothing has run on yet
m7md7sien Aug 3, 2026
35aa699
Correct what CI already covers
m7md7sien Aug 3, 2026
5feb5c5
Type-check the tagged suites in CI
m7md7sien Aug 3, 2026
52cedc3
Stop an update from overwriting the version it is updating
m7md7sien Aug 3, 2026
badd670
Print the job id in the line that tells you to use it
m7md7sien Aug 3, 2026
425171b
Stop reporting a run that could not run as one that passed
m7md7sien Aug 3, 2026
5e43f3c
Report the verdict the run was started to get
m7md7sien Aug 3, 2026
d01832c
Give CI a shape to read, and stop a slow token from failing a test
m7md7sien Aug 3, 2026
a2fd7e3
Drive the CI reattach path end to end
m7md7sien Aug 3, 2026
7fe9946
Satisfy the two repo-wide checks this extension was failing
m7md7sien Aug 4, 2026
bb5362e
Keep a command from shadowing the flags M1 promises everywhere
m7md7sien Aug 4, 2026
d2b4d19
Prove a dataset version cannot be written over, and drop a working no…
m7md7sien Aug 4, 2026
11d37c0
Print the run summary and the row listing the way the spec describes …
m7md7sien Aug 4, 2026
ac0e7c2
Stop a stale version listing from failing a dataset update
m7md7sien Aug 4, 2026
a244703
Keep azure.ai.evaluations out of the foundry bundle
m7md7sien Aug 4, 2026
359430a
Drop the azure.ai.projects dependency
m7md7sien Aug 4, 2026
cc4febb
Drop COMMANDS.md
m7md7sien Aug 4, 2026
64c02db
Move the configuration to one file holding many evals
m7md7sien Aug 5, 2026
4591118
Keep an eval across a rename, and bound the first trace run
m7md7sien Aug 5, 2026
7c052ad
Say which eval on one flag, and let a run read another dataset
m7md7sien Aug 5, 2026
7da5c1b
Nest generation jobs under what produced them, and add eval create
m7md7sien Aug 5, 2026
b8d4027
Send the sources --from named, and pick a default that works
m7md7sien Aug 5, 2026
2fb79a7
Point CI at templates that exist, and verify the provider it declares
m7md7sien Aug 6, 2026
a0bb3e0
Read the agent's instructions from the project before asking the service
m7md7sien Aug 6, 2026
2d4ce00
Test the export writers and portal URLs, and delete what duplicated them
m7md7sien Aug 6, 2026
b5b56d2
Cover the mechanisms that fail silently when they drift
m7md7sien Aug 6, 2026
0fae3f9
Check the run flags against the spec's own table
m7md7sien Aug 6, 2026
f7e4d6a
Repair the tagged suites, and stop them rotting unnoticed
m7md7sien Aug 6, 2026
21a8b5f
Suggest commands this extension actually serves
m7md7sien Aug 6, 2026
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
28 changes: 28 additions & 0 deletions .github/workflows/lint-ext-azure-ai-evaluations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ext-azure-ai-evaluations-ci

on:
pull_request:
paths:
- "cli/azd/extensions/azure.ai.evaluations/**"
- ".github/workflows/lint-ext-azure-ai-evaluations.yml"
- ".github/workflows/verify-ext-providers.yml"
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write # required by reusable workflow lint-go.yml

jobs:
lint:
uses: ./.github/workflows/lint-go.yml
with:
working-directory: cli/azd/extensions/azure.ai.evaluations

verify-providers:
uses: ./.github/workflows/verify-ext-providers.yml
with:
working-directory: cli/azd/extensions/azure.ai.evaluations
5 changes: 5 additions & 0 deletions cli/azd/extensions/azure.ai.evaluations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Test report written by ci-test.ps1 for the pipeline to publish.
junitTestReport.xml

# Debug log written when --debug or AZD_EXT_DEBUG is set.
azd-ai-eval-*.log
21 changes: 21 additions & 0 deletions cli/azd/extensions/azure.ai.evaluations/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "2"

linters:
default: none
enable:
- gosec
- lll
- unused
- errorlint
settings:
lll:
line-length: 220
tab-width: 4
gosec:
excludes:
- G204 # Subprocess launched with variable (bicep build invoked in tests)
- G304 # Potential file inclusion via variable

formatters:
enable:
- gofmt
27 changes: 27 additions & 0 deletions cli/azd/extensions/azure.ai.evaluations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

### Features Added

- Initial release of the Foundry evaluations extension, `azd ai eval`.
- `init` scaffolds `evals/eval_generate.yaml` and `evals/azure.yaml` next to an
agent, making no service calls.
- `generate` synthesizes a rubric and dataset from the agent's context, writes
them under `evals/`, and merges `source:` references into the deployment spec
while preserving comments, ordering and neighboring entries.
- `run` creates the eval group when it does not exist, starts a run, and
summarizes the result.
- `azure.ai.eval` service-target provider deploys datasets, evaluators and eval
groups during `azd up`, reconciling them in dependency order.
- Change detection so a repeated `azd up` publishes no redundant versions:
datasets are fingerprinted locally, evaluator definitions are compared on the
keys the author wrote, and eval groups are recreated only when their own
declaration changes.
- Atomic commands for every operation: `dataset`, `evaluator`, `run` and
`results` subcommands, all supporting `-o json` and `--no-prompt`.
- Testing criteria are shaped from each evaluator's published contract, so
evaluators requiring inputs beyond the agent shape — `ground_truth`,
`context`, `instruction_id_list` — work by binding them to dataset columns.
A required column the dataset does not carry is reported before the request
is sent, naming the column.
158 changes: 158 additions & 0 deletions cli/azd/extensions/azure.ai.evaluations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Azure Developer CLI (azd) Evaluations Extension

Define Foundry evaluations alongside your agent in `azure.yaml`, deploy them
with `azd up`, and run them from the terminal.

```bash
azd ai eval init # scaffold evals/ next to your agent
azd ai eval generate # synthesize a rubric and dataset from the agent
azd up # register datasets and evaluators, create the eval group
azd ai eval run # run the evaluation and summarize the results
```

## What gets deployed

Eval resources are one service entry in `azure.yaml`, normally a `$ref` to a
file under `evals/`:

```yaml
# azure.yaml
services:
ai-project:
host: azure.ai.project
evals:
host: azure.ai.eval
uses: [ai-project]
$ref: ./evals/azure.yaml
```

```yaml
# evals/azure.yaml
datasets:
- name: support-golden
source: ./datasets/support-golden.jsonl

evaluators:
- name: support-quality
source: ./evaluators/support-quality.json

evalGroups:
- name: support-quality
dataset: support-golden
evaluators:
- builtin.task_adherence
- support-quality
target:
type: agent
name: support-agent
options:
eval_model: gpt-4.1-nano
```

`azd up` reconciles **datasets → evaluators → eval groups**, in that order,
because a group references the versions the first two resolve to.

Relative paths inside a `$ref`'d file resolve against **that file's**
directory, so `./datasets/x.jsonl` above means `evals/datasets/x.jsonl`.

### Repeated deploys do not create redundant versions

Datasets are fingerprinted locally, because the dataset API exposes no content
hash and comparing against the service would mean downloading the blob on every
deploy. Evaluator definitions are compared against the service, but only on the
keys you authored — the service adds `data_schema`, `init_parameters` and
`metrics` of its own.

Eval groups are immutable, so a change to a group's evaluators, target or
options creates a new group and a new id. The id is cached in the azd
environment so repeat runs stay comparable.

## Commands

| Group | Commands |
|---|---|
| `azd ai eval` | `init` · `generate` · `run` |
| `azd ai eval dataset` | `create` · `list` · `show` · `update` · `delete` |
| `azd ai eval evaluator` | `upload` · `list` · `show` · `update` · `delete` · `builtins` |
| `azd ai eval run` | `start` · `list` · `show` · `cancel` |
| `azd ai eval results` | `show` · `export` |

`create` and `update` both publish a new immutable version; the server
auto-increments and nothing mutates in place.

Every command supports `-o json` and `--no-prompt`, so the whole surface is
usable from CI.

## Evaluators

Built-ins need no declaration — reference them as `builtin.<name>` and list
them with `azd ai eval evaluator builtins`.

Evaluators do not share an input contract, so the CLI reads each one's
published contract and shapes the request to match. An evaluator needing an
input your dataset does not carry is reported before the request is sent, with
the column named, rather than as a service-side rejection.

A custom rubric is a JSON list of weighted dimensions:

```json
{
"dimensions": [
{ "id": "accuracy", "description": "The answer is factually correct.", "weight": 5 },
{ "id": "tone", "description": "The answer is polite and professional.", "weight": 2 }
]
}
```

`weight` is an **integer from 1 to 10**. Weights do not need to sum to
anything.

## Choosing a project

The project endpoint is resolved in this order:

1. `--project-endpoint`
2. `FOUNDRY_PROJECT_ENDPOINT` in the active azd environment
3. the host environment variable of the same name

## Local development

### Prerequisites

- Go (the version in `go.mod`; `GOTOOLCHAIN=auto` fetches it)
- [azd](https://aka.ms/azd) and the extension developer kit:
`azd ext install microsoft.azd.extensions`

### Build, test, install

```bash
azd x build # compile and install into the local azd
azd x pack # package the artifacts
azd x publish # register in the local extension source
azd ext install azure.ai.evaluations --source local
```

```bash
go test ./internal/... # unit tests
```

### Live integration tests

These talk to a real Foundry project, so they are excluded from the default
build by the `live` tag and additionally gated on an environment variable:

```bash
export AZURE_AI_EVAL_E2E_LIVE=1
export FOUNDRY_PROJECT_ENDPOINT=https://<account>.services.ai.azure.com/api/projects/<project>
export AZURE_AI_EVAL_MODEL=gpt-4.1-nano # optional judge model
export AZURE_AI_EVAL_AGENT=<agent-name> # optional, enables the run phase

go test -tags live ./internal/cmd/ ./tests/live/
```

They clean up every resource they create.

### Debug logging

Request tracing is off by default. `--debug`, or `AZD_EXT_DEBUG=true`, writes
it to a dated log file rather than the terminal.
78 changes: 78 additions & 0 deletions cli/azd/extensions/azure.ai.evaluations/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Ensure script fails on any error
$ErrorActionPreference = 'Stop'

# Get the directory of the script
$EXTENSION_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path

# Change to the script directory
Set-Location -Path $EXTENSION_DIR

# Create a safe version of EXTENSION_ID replacing dots with dashes
$EXTENSION_ID_SAFE = $env:EXTENSION_ID -replace '\.', '-'

# Define output directory
$OUTPUT_DIR = if ($env:OUTPUT_DIR) { $env:OUTPUT_DIR } else { Join-Path $EXTENSION_DIR "bin" }

# Create output directory if it doesn't exist
if (-not (Test-Path -Path $OUTPUT_DIR)) {
New-Item -ItemType Directory -Path $OUTPUT_DIR | Out-Null
}

# Get Git commit hash and build date
$COMMIT = git rev-parse HEAD
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to get git commit hash"
exit 1
}
$BUILD_DATE = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ")

# List of OS and architecture combinations
if ($env:EXTENSION_PLATFORM) {
$PLATFORMS = @($env:EXTENSION_PLATFORM)
}
else {
$PLATFORMS = @(
"windows/amd64",
"windows/arm64",
"darwin/amd64",
"darwin/arm64",
"linux/amd64",
"linux/arm64"
)
}

$VERSION_PATH = "azureaieval/internal/version"

# Loop through platforms and build
foreach ($PLATFORM in $PLATFORMS) {
$OS, $ARCH = $PLATFORM -split '/'

$OUTPUT_NAME = Join-Path $OUTPUT_DIR "$EXTENSION_ID_SAFE-$OS-$ARCH"

if ($OS -eq "windows") {
$OUTPUT_NAME += ".exe"
}

Write-Host "Building for $OS/$ARCH..."

# Delete the output file if it already exists
if (Test-Path -Path $OUTPUT_NAME) {
Remove-Item -Path $OUTPUT_NAME -Force
}

# Set environment variables for Go build
$env:GOOS = $OS
$env:GOARCH = $ARCH

go build `
-ldflags="-X '$VERSION_PATH.Version=$env:EXTENSION_VERSION' -X '$VERSION_PATH.Commit=$COMMIT' -X '$VERSION_PATH.BuildDate=$BUILD_DATE'" `
-o $OUTPUT_NAME

if ($LASTEXITCODE -ne 0) {
Write-Host "An error occurred while building for $OS/$ARCH"
exit 1
}
}

Write-Host "Build completed successfully!"
Write-Host "Binaries are located in the $OUTPUT_DIR directory."
66 changes: 66 additions & 0 deletions cli/azd/extensions/azure.ai.evaluations/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# Get the directory of the script
EXTENSION_DIR="$(cd "$(dirname "$0")" && pwd)"

# Change to the script directory
cd "$EXTENSION_DIR" || exit

# Create a safe version of EXTENSION_ID replacing dots with dashes
EXTENSION_ID_SAFE="${EXTENSION_ID//./-}"

# Define output directory
OUTPUT_DIR="${OUTPUT_DIR:-$EXTENSION_DIR/bin}"

# Create output and target directories if they don't exist
mkdir -p "$OUTPUT_DIR"

# Get Git commit hash and build date
COMMIT=$(git rev-parse HEAD)
BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)

# List of OS and architecture combinations
if [ -n "$EXTENSION_PLATFORM" ]; then
PLATFORMS=("$EXTENSION_PLATFORM")
else
PLATFORMS=(
"windows/amd64"
"windows/arm64"
"darwin/amd64"
"darwin/arm64"
"linux/amd64"
"linux/arm64"
)
fi

VERSION_PATH="azureaieval/internal/version"

# Loop through platforms and build
for PLATFORM in "${PLATFORMS[@]}"; do
OS=$(echo "$PLATFORM" | cut -d'/' -f1)
ARCH=$(echo "$PLATFORM" | cut -d'/' -f2)

OUTPUT_NAME="$OUTPUT_DIR/$EXTENSION_ID_SAFE-$OS-$ARCH"

if [ "$OS" = "windows" ]; then
OUTPUT_NAME+='.exe'
fi

echo "Building for $OS/$ARCH..."

# Delete the output file if it already exists
[ -f "$OUTPUT_NAME" ] && rm -f "$OUTPUT_NAME"

# Set environment variables for Go build
GOOS=$OS GOARCH=$ARCH go build \
-ldflags="-X '$VERSION_PATH.Version=$EXTENSION_VERSION' -X '$VERSION_PATH.Commit=$COMMIT' -X '$VERSION_PATH.BuildDate=$BUILD_DATE'" \
-o "$OUTPUT_NAME"

if [ $? -ne 0 ]; then
echo "An error occurred while building for $OS/$ARCH"
exit 1
fi
done

echo "Build completed successfully!"
echo "Binaries are located in the $OUTPUT_DIR directory."
Loading