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
90 changes: 90 additions & 0 deletions .github/workflows/release-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Release bindings

on:
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: Existing release tag to attach artifacts to, for example v0.9.1
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: build-${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: libere_verifier_c.linux-amd64.tar.gz
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
archive: libere_verifier_c.linux-arm64.tar.gz
- os: macos-latest
target: x86_64-apple-darwin
archive: libere_verifier_c.darwin-amd64.tar.gz
- os: macos-latest
target: aarch64-apple-darwin
archive: libere_verifier_c.darwin-arm64.tar.gz
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-05-01

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0

- name: Install cargo-zigbuild
uses: taiki-e/install-action@v2
with:
tool: cargo-zigbuild

- name: Build and package
run: bash bindings/scripts/build.sh "${{ matrix.target }}" "${{ matrix.archive }}"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: ${{ matrix.archive }}
if-no-files-found: error

upload:
name: upload-release-assets
needs: build
if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Attach artifacts to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || github.event.release.tag_name }}
files: artifacts/**/*
71 changes: 71 additions & 0 deletions .github/workflows/test-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test bindings

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

on:
push:
branches:
- master
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test bindings
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-13
target: x86_64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-05-01

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0

- name: Install cargo-zigbuild
uses: taiki-e/install-action@v2
with:
tool: cargo-zigbuild

- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: bindings/golang/go.mod

- name: Run C binding tests
run: cargo test --release -p ere-verifier-c

- name: Build the static library
run: bash bindings/scripts/build.sh ${{ matrix.target }} libere_verifier_c.tar.gz

- name: Run Go binding tests
shell: bash
run: |
LIBDIR="$(mktemp -d)"
tar -xzf libere_verifier_c.tar.gz -C "$LIBDIR"
cd bindings/golang
CGO_CFLAGS="-I$LIBDIR" CGO_LDFLAGS="-L$LIBDIR" go test ./...
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ target
notes.md
dory_srs_*_variables.srs
.vscode
.DS_Store
.DS_Store
*.tar.gz
Loading
Loading