From bfe8cb43c51d4f1a8806d6704e86f569514fde4d Mon Sep 17 00:00:00 2001 From: Santiago Date: Sat, 13 Jun 2026 21:04:34 -0300 Subject: [PATCH 1/2] build(dist): ship u5c (utxorpc) in released binaries Enable the u5c feature for the cargo-dist release build via [package.metadata.dist], so the installers/archives include the utxorpc source. dist switches to precise-builds and compiles with --features u5c; release.yml is unchanged (features apply at build time). Cost: ~+2.2 MB stripped over the base binary (~12 MB -> ~14 MB). Co-Authored-By: Claude Opus 4.8 (1M context) --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6da44d6b..cb77fc94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,11 @@ hydra = ["tungstenite", "tokio-tungstenite", "futures-util", "bytes"] # elasticsearch = auto feature flag # kafka = auto feature flag +# Features enabled in the cargo-dist released binaries (installers, archives). +# u5c (utxorpc) ships by default; ~+2.2 MB stripped over the base binary. +[package.metadata.dist] +features = ["u5c"] + [dependencies] pallas = { version = "1.1", features = ["hardano"] } # pallas = { path = "../pallas/pallas", features = ["hardano"] } From e01af96fe9b1ab73358fe7d62ca33b5b849d440e Mon Sep 17 00:00:00 2001 From: Santiago Date: Sat, 13 Jun 2026 21:07:15 -0300 Subject: [PATCH 2/2] ci: add Docker build/publish workflow on push to main Compiles native per-arch binaries (x86_64, arm64) and assembles a multi-arch image pushed to ghcr.io/txpipe/oura, mirroring the approach used in Dolos. Publishes :latest on main and :stable + semver tags on v* releases. Uses oura's CI idioms (rustup honoring rust-toolchain.toml, Swatinem cache, setup-protoc) rather than archived actions-rs actions. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/image/Dockerfile | 10 ++++ .github/workflows/docker.yml | 109 +++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 .github/image/Dockerfile create mode 100644 .github/workflows/docker.yml diff --git a/.github/image/Dockerfile b/.github/image/Dockerfile new file mode 100644 index 00000000..9cce4bf1 --- /dev/null +++ b/.github/image/Dockerfile @@ -0,0 +1,10 @@ +FROM debian:12-slim + +RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* + +ARG TARGETARCH +COPY bin/oura-Linux-${TARGETARCH} /bin/oura +RUN chmod +x /bin/oura +RUN ln -s /bin/oura /oura + +ENTRYPOINT [ "oura" ] diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..34132930 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,109 @@ +name: Docker + +on: + push: + branches: + - main + tags: + - "v*" + +jobs: + build: + strategy: + matrix: + include: + - release_for: Linux-x86_64 + build_on: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + + - release_for: Linux-arm64 + build_on: ubuntu-22.04-arm + target: aarch64-unknown-linux-gnu + + runs-on: ${{ matrix.build_on }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Installs the toolchain + components pinned in rust-toolchain.toml. + - name: Install Rust toolchain + run: rustup show active-toolchain || rustup toolchain install + + - name: Install Protoc + uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: Swatinem/rust-cache@v2 + with: + shared-key: docker-${{ matrix.target }} + + - name: Run cargo build + run: cargo build --target ${{ matrix.target }} --all-features --locked --release + + - name: Rename binary + run: mv target/${{ matrix.target }}/release/oura oura-${{ matrix.release_for }} + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: binaries-${{ matrix.release_for }} + path: oura-${{ matrix.release_for }} + + docker: + runs-on: ubuntu-latest + needs: [build] + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/txpipe/oura + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=stable,enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern=v{{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern=v{{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern=v{{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=sha + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: binaries-* + merge-multiple: true + path: .github/image/bin + + # Rename the artifact so the suffix matches the value Docker uses for + # TARGETARCH (amd64), keeping the Dockerfile COPY simple. arm64 already + # matches. + - name: Rename artifacts + run: mv .github/image/bin/oura-Linux-x86_64 .github/image/bin/oura-Linux-amd64 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: .github/image + platforms: linux/arm64,linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}