Files
orbit/.gitea/workflows/rolling-release.yml
T
nandiandClaude Opus 5.5 83e694c6c4
Rolling Release / build (push) Successful in 1m39s
Rolling Release / publish (push) Successful in 8s
Prove the semver and solver kernel instead of testing it
Move number parsing, version ordering and constraints, version sorting and
solver literals into src/kernel, with contracts checked by moon prove under
overflow-checked integers. Replace the semver behaviour tests with those
proofs, keep tests for string parsing, and run the proofs in CI.

Version numbers are now 64-bit: the old parser silently wrapped at 2^31.
Drop pick_tag, which only tests called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:56:21 -08:00

111 lines
3.4 KiB
YAML

name: Rolling Release
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# Never cancelled, so a newer push can't interrupt a release half way.
concurrency:
group: rolling-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
env:
MOONBIT_VERSION: 0.10.20+65efd5b93
Z3_VERSION: 5.3.3
Z3_SHA256: d56f60b06f432f33de5810f7f1a384a339131f361e2d54d08ea83eea14326880
ZIG_VERSION: 0.17.1
ZIG_SHA256: 3581863e3cbcfd0fce0efc682ce7e9e93da96668a977791d356a26d2a7e9b17a
jobs:
build:
runs-on: depot-ubuntu-24.04-4
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
missing=
for tool in gcc make perl readelf curl xz; do
command -v "$tool" >/dev/null || missing=1
done
if [ -n "$missing" ]; then
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends build-essential perl curl xz-utils >/dev/null
fi
- name: Install MoonBit
run: |
curl -fsSL --retry 5 https://cli.moonbitlang.com/install/unix.sh | bash -s -- "$MOONBIT_VERSION"
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
"$HOME/.moon/bin/moon" update
"$HOME/.moon/bin/moon" version --all
- name: Install Zig
run: |
curl -fsSL --retry 5 -o "$RUNNER_TEMP/zig.tar.xz" \
"https://ziglang.org/download/$ZIG_VERSION/zig-x86_64-linux-$ZIG_VERSION.tar.xz"
echo "$ZIG_SHA256 $RUNNER_TEMP/zig.tar.xz" | sha256sum -c -
tar -xJf "$RUNNER_TEMP/zig.tar.xz" -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/zig-x86_64-linux-$ZIG_VERSION" >> "$GITHUB_PATH"
- name: Test
run: moon test --target native
# Proofs replace tests of src/kernel. The override checks for overflow;
# `just prove` runs the same command.
- name: Prove
run: |
z3="z3-$Z3_VERSION-x64-glibc-2.39"
curl -fsSL --retry 5 -o "$RUNNER_TEMP/z3.zip" \
"https://github.com/Z3Prover/z3/releases/download/z3-$Z3_VERSION/$z3.zip"
echo "$Z3_SHA256 $RUNNER_TEMP/z3.zip" | sha256sum -c -
python3 -m zipfile -e "$RUNNER_TEMP/z3.zip" "$RUNNER_TEMP"
chmod +x "$RUNNER_TEMP/$z3/bin/z3"
export Z3PATH="$RUNNER_TEMP/$z3/bin/z3"
export MOON_PROVE_PRELUDE_OVERRIDE="$HOME/.moon/lib/prelude_proof_machine_int"
moon prove src/kernel
- name: Build static binary
run: scripts/build-musl.sh
# A real HTTPS install: proves the linked-in OpenSSL and CA lookup work.
- name: Smoke test
run: |
export ORBIT_ROOT="$RUNNER_TEMP/orbit-smoke"
dist/orbit-linux-x86_64 install hello
"$ORBIT_ROOT/bin/hello"
- uses: actions/upload-artifact@v3
with:
name: orbit-linux-x86_64
path: dist/
if-no-files-found: error
publish:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: depot-ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: orbit-linux-x86_64
path: dist/
- name: Publish rolling release
env:
GITEA_TOKEN: ${{ github.token }}
run: |
(cd dist && sha256sum -c SHA256SUMS)
python3 scripts/publish-rolling.py