Skip to content

Bump packages to beta #7

Bump packages to beta

Bump packages to beta #7

name: Release dry run
on:
push:
branches: ["main"]
pull_request:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'core/**'
- 'generator/**'
- 'integrations/**/Cargo.toml'
- 'sdk/dotnet/**'
- 'sdk/node/**'
- 'sdk/python/**'
- 'sdk/rust/**'
- 'scripts/check_package_metadata.py'
- '.github/workflows/release-artifacts.yml'
- '.github/workflows/release-dry-run.yml'
- 'RELEASING.md'
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
dry-run:
name: Package dry runs
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: sdk/node/package-lock.json
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Verify metadata and workflow YAML
run: |
python -m pip install --upgrade pip
python -m pip install pyyaml
python scripts/check_package_metadata.py
python - <<'PY'
from pathlib import Path
import yaml
for path in sorted(Path(".github/workflows").glob("*.yml")):
with path.open(encoding="utf-8") as handle:
yaml.safe_load(handle)
print(f"parsed {path}")
PY
- name: Rust package dry run
run: |
cargo package --allow-dirty --no-verify \
-p agent_control_specification_core \
-p agent_control_specification \
-p agent_control_specification_rig \
-p agent_control_specification_annotators \
-p agent_control_specification_otel
cargo publish --dry-run --allow-dirty --no-verify -p agent_control_specification_core
- name: Python distribution dry run
run: |
python -m pip install 'maturin>=1.0,<2.0'
cd sdk/python
maturin build --release --sdist --out "$RUNNER_TEMP/acs-python-dist"
test -n "$(find "$RUNNER_TEMP/acs-python-dist" -type f -name '*.whl' -print -quit)"
test -n "$(find "$RUNNER_TEMP/acs-python-dist" -type f -name '*.tar.gz' -print -quit)"
- name: Node package dry run
working-directory: sdk/node
run: |
npm ci
npm run build
npm pack --dry-run --json > "$RUNNER_TEMP/node-main-pack.json"
node - <<'NODE'
const fs = require('node:fs');
const files = JSON.parse(fs.readFileSync(process.env.RUNNER_TEMP + '/node-main-pack.json', 'utf8'))[0].files.map((file) => file.path);
const native = files.filter((file) => file.endsWith('.node'));
if (native.length > 0) {
throw new Error(`main package unexpectedly included native bindings: ${native.join(', ')}`);
}
console.log('main package excludes native .node files');
NODE
if npm pack ./npm/agent-control-specification-linux-x64-gnu --dry-run > "$RUNNER_TEMP/native-guard.log" 2>&1; then
cat "$RUNNER_TEMP/native-guard.log"
echo "expected native package guard to reject missing binary"
exit 1
fi
grep -q 'missing or empty' "$RUNNER_TEMP/native-guard.log"
if npm pack ./npm/agent-control-specification-opa-darwin-arm64 --dry-run > "$RUNNER_TEMP/opa-guard.log" 2>&1; then
cat "$RUNNER_TEMP/opa-guard.log"
echo "expected OPA package guard to reject missing binary"
exit 1
fi
grep -q 'missing or empty' "$RUNNER_TEMP/opa-guard.log"
node --check scripts/fetch-opa.mjs
grep -q 'missing pinned checksum' scripts/fetch-opa.mjs
- name: .NET package dry run
run: |
if dotnet pack sdk/dotnet/src/AgentControlSpecification/AgentControlSpecification.csproj \
--configuration Release \
--output "$RUNNER_TEMP/acs-dotnet-pack" > "$RUNNER_TEMP/dotnet-pack-default.log" 2>&1; then
cat "$RUNNER_TEMP/dotnet-pack-default.log"
echo "expected default pack to require all native runtime assets"
exit 1
fi
grep -q 'required native runtime assets are missing' "$RUNNER_TEMP/dotnet-pack-default.log"
dotnet pack sdk/dotnet/src/AgentControlSpecification/AgentControlSpecification.csproj \
--configuration Release \
--output "$RUNNER_TEMP/acs-dotnet-pack-allow" \
-p:AgentControlSpecificationAllowIncompleteNativePack=true