Skip to content
Open
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
32 changes: 16 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,30 +145,30 @@ jobs:
# Create platform-specific filename for direct CGO usage
case "${{ matrix.platform }}" in
darwin-arm64)
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/protect/libprotect_ffi_darwin_arm64.a
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_darwin_arm64.a
;;
darwin-x64)
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/protect/libprotect_ffi_darwin_x64.a
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_darwin_x64.a
;;
linux-arm64-musl)
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/protect/libprotect_ffi_linux_arm64_musl.a
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_linux_arm64_musl.a
;;
linux-x64-musl)
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/protect/libprotect_ffi_linux_x64_musl.a
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_linux_x64_musl.a
;;
linux-arm64-gnu)
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/protect/libprotect_ffi_linux_arm64.a
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_linux_arm64.a
;;
linux-x64-gnu)
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/protect/libprotect_ffi_linux_x64.a
cp target/${{ matrix.rust_target }}/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_linux_x64.a
;;
esac

- name: Upload library artifact
uses: actions/upload-artifact@v4
with:
name: library-${{ matrix.platform }}
path: pkg/protect/libprotect_ffi_*.a
path: pkg/encryption/libprotect_ffi_*.a
retention-days: 30

# Run Go unit tests against the freshly built native libraries
Expand Down Expand Up @@ -199,10 +199,10 @@ jobs:
uses: actions/download-artifact@v4
with:
name: library-${{ matrix.platform }}
path: pkg/protect
path: pkg/encryption

- name: Run Go tests
run: go test ./pkg/protect/...
run: go test ./pkg/encryption/...

# Commit all generated libraries at once
commit-artifacts:
Expand Down Expand Up @@ -234,30 +234,30 @@ jobs:

# Copy platform-specific files to package directory
if [ -f "$artifact_dir/libprotect_ffi_darwin_arm64.a" ]; then
cp "$artifact_dir/libprotect_ffi_darwin_arm64.a" "pkg/protect/"
cp "$artifact_dir/libprotect_ffi_darwin_arm64.a" "pkg/encryption/"
fi
if [ -f "$artifact_dir/libprotect_ffi_darwin_x64.a" ]; then
cp "$artifact_dir/libprotect_ffi_darwin_x64.a" "pkg/protect/"
cp "$artifact_dir/libprotect_ffi_darwin_x64.a" "pkg/encryption/"
fi
if [ -f "$artifact_dir/libprotect_ffi_linux_arm64.a" ]; then
cp "$artifact_dir/libprotect_ffi_linux_arm64.a" "pkg/protect/"
cp "$artifact_dir/libprotect_ffi_linux_arm64.a" "pkg/encryption/"
fi
if [ -f "$artifact_dir/libprotect_ffi_linux_x64.a" ]; then
cp "$artifact_dir/libprotect_ffi_linux_x64.a" "pkg/protect/"
cp "$artifact_dir/libprotect_ffi_linux_x64.a" "pkg/encryption/"
fi
if [ -f "$artifact_dir/libprotect_ffi_linux_arm64_musl.a" ]; then
cp "$artifact_dir/libprotect_ffi_linux_arm64_musl.a" "pkg/protect/"
cp "$artifact_dir/libprotect_ffi_linux_arm64_musl.a" "pkg/encryption/"
fi
if [ -f "$artifact_dir/libprotect_ffi_linux_x64_musl.a" ]; then
cp "$artifact_dir/libprotect_ffi_linux_x64_musl.a" "pkg/protect/"
cp "$artifact_dir/libprotect_ffi_linux_x64_musl.a" "pkg/encryption/"
fi
done

- name: Commit and push all artifacts
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pkg/protect/*.a
git add pkg/encryption/*.a
if git diff --cached --quiet; then
echo "No changes to commit"
else
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Please use the GitHub issue tracker to report bugs, suggest features, or documentation improvements.

[When filing an issue](https://github.com/cipherstash/protectgo/issues/new/choose), please check [existing open](https://github.com/cipherstash/protectgo/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc), or [recently closed](https://github.com/cipherstash/protectgo/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed), issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can.
[When filing an issue](https://github.com/cipherstash/goencryption/issues/new/choose), please check [existing open](https://github.com/cipherstash/goencryption/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc), or [recently closed](https://github.com/cipherstash/goencryption/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed), issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can.

---

Expand Down
14 changes: 7 additions & 7 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ The project consists of:

1. **Rust C library** (`crates/protect-ffi-c/`) — a Rust crate that exports
C-compatible functions and generates the `protect_ffi.h` header.
2. **Go package** (`pkg/protect/`) — Go bindings that link the compiled static
2. **Go package** (`pkg/encryption/`) — Go bindings that link the compiled static
library via cgo and expose an idiomatic Go API.
3. **Examples** (`examples/`) — runnable usage examples.

```
protectgo/
goencryption/
├── crates/
│ └── protect-ffi-c/ # Rust C FFI library
├── pkg/protect/ # Go package + precompiled static libraries
├── pkg/encryption/ # Go package + precompiled static libraries
├── examples/ # Usage examples
```

Expand All @@ -30,7 +30,7 @@ protectgo/
## How the native library is built

The Go package links a precompiled static library per platform, checked in under
`pkg/protect/` (for example `libprotect_ffi_darwin_arm64.a`). These are produced
`pkg/encryption/` (for example `libprotect_ffi_darwin_arm64.a`). These are produced
in CI (see `.github/workflows/build.yml`) and committed back to the repo, so day
-to-day Go development does not require a Rust toolchain.

Expand All @@ -42,10 +42,10 @@ cargo build --release

# Copy the resulting archive to the matching platform filename, e.g. on Apple
# Silicon:
cp target/release/libprotect_ffi.a pkg/protect/libprotect_ffi_darwin_arm64.a
cp target/release/libprotect_ffi.a pkg/encryption/libprotect_ffi_darwin_arm64.a
```

The header `pkg/protect/protect_ffi.h` is regenerated by the crate's build
The header `pkg/encryption/protect_ffi.h` is regenerated by the crate's build
script (cbindgen) as part of `cargo build`.

## Building and testing the Go package
Expand Down Expand Up @@ -91,5 +91,5 @@ The Go bindings handle memory management for you:

For support and questions:

- GitHub Issues: [protectgo/issues](https://github.com/cipherstash/protectgo/issues)
- GitHub Issues: [goencryption/issues](https://github.com/cipherstash/goencryption/issues)
- CipherStash Documentation: [docs.cipherstash.com](https://docs.cipherstash.com)
Loading