aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / .github / workflows / release.yml
| 1 | name: Multi-OS Cross-Platform Release |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | tags: |
| 6 | - "v*" |
| 7 | workflow_dispatch: |
| 8 | inputs: |
| 9 | dry_run: |
| 10 | description: "Dry run: build, package, sign with a throwaway key, verify, upload workflow artifacts only. Never creates a release." |
| 11 | type: boolean |
| 12 | default: true |
| 13 | |
| 14 | permissions: |
| 15 | contents: read |
| 16 | |
| 17 | jobs: |
| 18 | build-release: |
| 19 | name: Build ${{ matrix.target }} |
| 20 | runs-on: ${{ matrix.os }} |
| 21 | strategy: |
| 22 | fail-fast: false |
| 23 | matrix: |
| 24 | include: |
| 25 | # Only the native candidate target is released: the candidate manifest has executable digests for it alone, |
| 26 | # and the gate refuses any package without them (scripts/check-release-candidate.sh --native is required). |
| 27 | - os: ubuntu-24.04-arm |
| 28 | target: aarch64-unknown-linux-gnu |
| 29 | artifact_name: sovereign-linux-aarch64.tar.gz |
| 30 | use_tar: true |
| 31 | native_engine: true |
| 32 | |
| 33 | steps: |
| 34 | - name: Checkout Source |
| 35 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 36 | with: |
| 37 | persist-credentials: false |
| 38 | |
| 39 | - name: GNU tar (reproducible packages need it) |
| 40 | if: runner.os == 'macOS' |
| 41 | run: brew install gnu-tar |
| 42 | |
| 43 | - name: Install pinned Rust toolchain (rust-toolchain.toml) |
| 44 | run: | |
| 45 | rustup toolchain install "$(sed -n 's/^channel *= *"\(.*\)"/\1/p' rust-toolchain.toml)" --profile minimal |
| 46 | rustc --version |
| 47 | |
| 48 | - name: Release gate (candidate named, omega.lock and Cargo.lock pins equal the candidate's) |
| 49 | id: gate |
| 50 | continue-on-error: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} |
| 51 | run: scripts/check-release-candidate.sh |
| 52 | |
| 53 | - name: Read pins (omega.lock, then omega physics.lock) |
| 54 | id: pins |
| 55 | run: echo "omega=$(tr -d '[:space:]' < omega.lock)" >> "$GITHUB_OUTPUT" |
| 56 | |
| 57 | # The native engine is linked only on the candidate target (linux aarch64, the GB10 host class). |
| 58 | # Other targets build the CPU stub, are labelled as such in the release notes, and are not the candidate. |
| 59 | - name: Checkout omega at omega.lock |
| 60 | if: matrix.native_engine |
| 61 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 62 | with: |
| 63 | repository: aien-dev/omega-mv |
| 64 | ref: ${{ steps.pins.outputs.omega }} |
| 65 | path: omega |
| 66 | persist-credentials: false |
| 67 | |
| 68 | - name: Read physics pin and checkout physics |
| 69 | if: matrix.native_engine |
| 70 | id: physpin |
| 71 | run: | |
| 72 | echo "physics=$(tr -d '[:space:]' < omega/physics.lock)" >> "$GITHUB_OUTPUT" |
| 73 | echo "aienos=$(tr -d '[:space:]' < omega/aienos.lock)" >> "$GITHUB_OUTPUT" |
| 74 | |
| 75 | - name: Checkout physics at omega's physics.lock |
| 76 | if: matrix.native_engine |
| 77 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 78 | with: |
| 79 | repository: aien-dev/physics-mv |
| 80 | ref: ${{ steps.physpin.outputs.physics }} |
| 81 | path: physics |
| 82 | persist-credentials: false |
| 83 | |
| 84 | # omega builds its aienos authority capability from the aienos commit pinned in omega/aienos.lock (as ci.yml does). |
| 85 | - name: Checkout aienos at omega's aienos.lock |
| 86 | if: matrix.native_engine |
| 87 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 88 | with: |
| 89 | repository: aien-dev/aienux |
| 90 | ref: ${{ steps.physpin.outputs.aienos }} |
| 91 | path: aienos |
| 92 | persist-credentials: false |
| 93 | |
| 94 | - name: Build the candidate way (scripts/repro-build.sh, fresh CARGO_HOME, no mojo) |
| 95 | env: |
| 96 | CARGO_HOME: ${{ runner.temp }}/cargo-home |
| 97 | run: | |
| 98 | if command -v mojo >/dev/null 2>&1; then echo "mojo is on PATH; the candidate build runs without it" >&2; exit 1; fi |
| 99 | if [ "${{ matrix.native_engine }}" = "true" ]; then |
| 100 | export AIEN_OMEGA_DIR="$GITHUB_WORKSPACE/omega" AIEN_PHYSICS_DIR="$GITHUB_WORKSPACE/physics" AIEN_AIENOS_LOCK_REPO="$GITHUB_WORKSPACE/aienos" |
| 101 | fi |
| 102 | rm -rf "$CARGO_HOME" |
| 103 | cargo fetch --locked |
| 104 | # The one recipe (docs/release/BUILD_RECIPE.md): helpers as one group, then aien-cli alone and last. |
| 105 | scripts/release-build.sh |
| 106 | |
| 107 | - name: Package Release Assets (reproducible tarball, release.toml inside) |
| 108 | env: |
| 109 | AIEN_DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run && '1' || '' }} |
| 110 | run: | |
| 111 | bash scripts/package-release.sh "${{ matrix.artifact_name }}" |
| 112 | AIEN_SHA="$(sha256sum target/release/aien-cli 2>/dev/null || shasum -a 256 target/release/aien-cli)" |
| 113 | printf '%s %s native_engine=%s\n' "${AIEN_SHA%% *}" "${{ matrix.artifact_name }}" "${{ matrix.native_engine }}" > "aien-cli-sha256-${{ matrix.target }}.txt" |
| 114 | cat "aien-cli-sha256-${{ matrix.target }}.txt" |
| 115 | |
| 116 | - name: Check the package against the candidate (model inputs, files, aien-cli and helper digests, all bound to the candidate manifest) |
| 117 | id: pkgcheck |
| 118 | continue-on-error: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} |
| 119 | run: | |
| 120 | scripts/check-release-candidate.sh --package "${{ matrix.artifact_name }}" --native |
| 121 | |
| 122 | - name: Record dry-run status |
| 123 | if: always() && github.event_name == 'workflow_dispatch' && inputs.dry_run |
| 124 | run: | |
| 125 | { |
| 126 | echo "DRY RUN. This is not a release and must not be installed as a candidate." |
| 127 | echo "release gate: ${{ steps.gate.outcome }}" |
| 128 | echo "package check: ${{ steps.pkgcheck.outcome }}" |
| 129 | } > "DRY-RUN-STATUS-${{ matrix.target }}.txt" |
| 130 | cat "DRY-RUN-STATUS-${{ matrix.target }}.txt" |
| 131 | |
| 132 | - name: Upload Artifact |
| 133 | uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 134 | with: |
| 135 | name: ${{ matrix.target }} |
| 136 | path: | |
| 137 | ${{ matrix.artifact_name }} |
| 138 | aien-cli-sha256-${{ matrix.target }}.txt |
| 139 | DRY-RUN-STATUS-${{ matrix.target }}.txt |
| 140 | |
| 141 | # Offline-signing handoff (Drake ruling 1, sc#385; docs/release/RELEASE_SIGNING.md). No private release key is ever |
| 142 | # in CI, a secret, or this repository. Stage 1 (draft-release, below) builds and publishes checksums to a DRAFT |
| 143 | # release. Stage 2 is the operator, offline: sign SHA256SUMS.txt and upload SHA256SUMS.txt.sig to the draft. |
| 144 | # Stage 3 (.github/workflows/release-publish.yml) verifies that signature against docs/release/allowed_signers and |
| 145 | # only then publishes. Static guard: scripts/test-release-signing-workflow.sh. |
| 146 | dry-run-sign: |
| 147 | name: "Dry run: label, sign with a throwaway key made in this job, verify (signature_check dry-run-key)" |
| 148 | needs: build-release |
| 149 | if: github.event_name == 'workflow_dispatch' && inputs.dry_run |
| 150 | runs-on: ubuntu-latest |
| 151 | permissions: |
| 152 | contents: read |
| 153 | steps: |
| 154 | - name: Checkout Source |
| 155 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 156 | with: |
| 157 | persist-credentials: false |
| 158 | |
| 159 | - name: Download Build Artifacts |
| 160 | uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 161 | with: |
| 162 | path: release-artifacts |
| 163 | merge-multiple: true |
| 164 | |
| 165 | - name: "Label, checksums, throwaway signature, verification (DRY RUN, not a release)" |
| 166 | working-directory: release-artifacts |
| 167 | run: | |
| 168 | for a in sovereign-*.tar.gz; do |
| 169 | tar -xzOf "$a" ./release.toml | grep -qx 'dry-run = true' || { echo "$a: release.toml is not labelled dry-run" >&2; exit 1; } |
| 170 | done |
| 171 | echo "DRY RUN: signed with a throwaway key generated in this job and deleted (signature_check dry-run-key). Not the AIEN release key. Not a release. Never publish." > DRY-RUN-NOT-A-RELEASE.txt |
| 172 | cat aien-cli-sha256-*.txt > aien-cli-digests.txt |
| 173 | sha256sum sovereign-* aien-cli-digests.txt DRY-RUN-*.txt > SHA256SUMS.txt |
| 174 | umask 077 |
| 175 | ssh-keygen -q -t ed25519 -N "" -C aien-dry-run-throwaway -f "$RUNNER_TEMP/dry_key" |
| 176 | printf "aien-release %s\n" "$(cut -d" " -f1,2 "$RUNNER_TEMP/dry_key.pub")" > dry-run-signers |
| 177 | ssh-keygen -Y sign -f "$RUNNER_TEMP/dry_key" -n aien-release SHA256SUMS.txt |
| 178 | rm -f "$RUNNER_TEMP/dry_key" "$RUNNER_TEMP/dry_key.pub" |
| 179 | ../scripts/verify-release-assets.sh . dry-run-signers |
| 180 | cat SHA256SUMS.txt |
| 181 | |
| 182 | - name: "Negative control: the publish gate refuses this dry run, under the pinned key and under its own key" |
| 183 | run: | |
| 184 | if bash scripts/release-publish-gate.sh release-artifacts docs/release/allowed_signers; then |
| 185 | echo "publish gate accepted a dry run under docs/release/allowed_signers" >&2; exit 1 |
| 186 | fi |
| 187 | if bash scripts/release-publish-gate.sh release-artifacts release-artifacts/dry-run-signers; then |
| 188 | echo "publish gate accepted a dry run under its own throwaway key" >&2; exit 1 |
| 189 | fi |
| 190 | echo "publish gate refused the dry run, as it must" |
| 191 | |
| 192 | - name: Upload dry-run artifacts (workflow artifacts only, no release) |
| 193 | uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 194 | with: |
| 195 | name: dry-run-signed-assets |
| 196 | path: release-artifacts |
| 197 | |
| 198 | # Stage 1. Never signs and never publishes: it creates a DRAFT release holding the archives and SHA256SUMS.txt. |
| 199 | draft-release: |
| 200 | name: "Stage 1: checksums and a draft release (unsigned; the operator signs offline)" |
| 201 | needs: build-release |
| 202 | if: github.event_name == 'push' || inputs.dry_run == false |
| 203 | runs-on: ubuntu-latest |
| 204 | # Only draft creation needs repository write authority. |
| 205 | permissions: |
| 206 | contents: write |
| 207 | steps: |
| 208 | - name: Checkout Source |
| 209 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 210 | with: |
| 211 | persist-credentials: false |
| 212 | |
| 213 | - name: Refuse anything but a v* tag |
| 214 | run: | |
| 215 | if [ "$GITHUB_REF_TYPE" != tag ] || [ "${GITHUB_REF_NAME#v}" = "$GITHUB_REF_NAME" ]; then |
| 216 | echo "A release is drafted only from a v* tag (this run is on $GITHUB_REF_TYPE $GITHUB_REF_NAME). Nothing was drafted." >&2 |
| 217 | exit 1 |
| 218 | fi |
| 219 | |
| 220 | - name: Download Build Artifacts |
| 221 | uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 222 | with: |
| 223 | path: release-artifacts |
| 224 | merge-multiple: true |
| 225 | |
| 226 | - name: Generate Checksums |
| 227 | working-directory: release-artifacts |
| 228 | run: | |
| 229 | cat aien-cli-sha256-*.txt > aien-cli-digests.txt |
| 230 | sha256sum sovereign-* aien-cli-digests.txt > SHA256SUMS.txt |
| 231 | cat SHA256SUMS.txt |
| 232 | |
| 233 | - name: Create the draft release (no signature; not public until release-publish.yml verifies the offline signature) |
| 234 | env: |
| 235 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 236 | TAG: ${{ github.ref_name }} |
| 237 | run: | |
| 238 | if gh release view "$TAG" >/dev/null 2>&1; then |
| 239 | echo "A release named $TAG already exists. Refusing to replace it." >&2 |
| 240 | exit 1 |
| 241 | fi |
| 242 | { |
| 243 | echo "> DRAFT, AWAITING THE OFFLINE SIGNATURE. Not published. See docs/release/RELEASE_SIGNING.md." |
| 244 | echo |
| 245 | if [ -f RELEASE_NOTES.md ]; then cat RELEASE_NOTES.md; else echo "# AIEN Sovereign Core ${TAG}"; fi |
| 246 | echo |
| 247 | echo "## aien-cli digests (compare with the candidate manifest [executables] aien-cli-native-release)" |
| 248 | echo |
| 249 | echo "Columns: sha256 of target/release/aien-cli, archive, whether the native engine (omega at omega.lock) is linked. Only the native_engine=true linux-aarch64 row is the candidate binary." |
| 250 | echo |
| 251 | echo '```' |
| 252 | cat release-artifacts/aien-cli-digests.txt |
| 253 | echo '```' |
| 254 | } > release-notes-with-digests.md |
| 255 | cd release-artifacts |
| 256 | gh release create "$TAG" --draft --verify-tag sovereign-* aien-cli-digests.txt SHA256SUMS.txt \ |
| 257 | --title "AIEN Sovereign Core ${TAG}" \ |
| 258 | --notes-file ../release-notes-with-digests.md |