Skip to content

chore: release v0.7.1 (#77) #214

chore: release v0.7.1 (#77)

chore: release v0.7.1 (#77) #214

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
- 'docs/**'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable]
include:
- os: ubuntu-latest
rust: nightly
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy, rustfmt
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.rust }}-
- name: Check formatting
run: cargo fmt --check
- name: Clippy (default features)
run: cargo clippy -- -D warnings
- name: Clippy (indexer feature)
run: cargo clippy --features indexer -- -D warnings
- name: Build
run: cargo build --release
- name: Build with indexer
run: cargo build --release --features indexer
- name: Run unit tests
run: cargo test
- name: Run unit tests with indexer
run: cargo test --features indexer
- name: Run integration tests
run: cargo test --test integration
nix:
name: Nix Flake Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Cachix
uses: cachix/cachix-action@v16
with:
name: nxv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Flake check
run: nix flake check
docker:
name: Build & Push Docker (latest)
runs-on: ubuntu-latest
# Only push on main branch, not PRs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test, nix]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Cachix
uses: cachix/cachix-action@v16
with:
name: nxv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build Docker image
run: nix build .#packages.x86_64-linux.nxv-docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GHCR
run: |
# Load the image built by Nix and capture output
LOAD_OUTPUT=$(docker load < result)
echo "$LOAD_OUTPUT"
# Parse the loaded image reference from docker load output
# Format: "Loaded image: repo:tag" or "Loaded image ID: sha256:..."
if echo "$LOAD_OUTPUT" | grep -q "Loaded image:"; then
IMAGE_NAME=$(echo "$LOAD_OUTPUT" | sed -n 's/.*Loaded image: //p')
elif echo "$LOAD_OUTPUT" | grep -q "Loaded image ID:"; then
IMAGE_ID=$(echo "$LOAD_OUTPUT" | sed -n 's/.*Loaded image ID: //p')
IMAGE_NAME="$IMAGE_ID"
else
echo "Error: Could not parse docker load output"
exit 1
fi
echo "Loaded image: $IMAGE_NAME"
# Tag and push as latest
docker tag "$IMAGE_NAME" ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:latest
# Note: Release builds with static binaries are handled by .github/workflows/release.yml
# which triggers on tag pushes (v*) and uses Nix for reproducible static musl builds