Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .github/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
109 changes: 109 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
Loading