Skip to content

Commit

Permalink
build: binaries for linux, mac x86_64, mac M1, and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Mar 13, 2024
1 parent b193a0e commit 968e951
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:

- name: 🗄 Upload Executables to S3
run: |
aws s3 cp --acl public-read ./hyper-copy s3://hyperland
echo "aliasing latest linux binary to 'hyper-copy'"
cp ./build/hyper-copy-x86_64-unknown-linux-gnu ./build/hyper-copy
echo "copying binaries to hyperland s3 ⚡️"
aws s3 cp --acl public-read --recursive ./build s3://hyperland

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
hyper-copy
hyper-copy
build
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
clean:
@rm -rf ./build

compile-linux:
@deno compile --target=x86_64-unknown-linux-gnu \
--allow-net --unstable --no-check \
--output ./build/hyper-copy-x86_64-unknown-linux-gnu mod.js

compile-apple:
@deno compile --target=x86_64-apple-darwin \
--allow-net --unstable --no-check \
--output ./build/hyper-copy-x86_64-apple-darwin mod.js

compile-arch-apple:
@deno compile --target=aarch64-apple-darwin \
--allow-net --unstable --no-check \
--output ./build/hyper-copy-aarch64-apple-darwin mod.js

compile-windows:
@deno compile --target=x86_64-pc-windows-msvc \
--allow-net --unstable --no-check \
--output ./build/hyper-copy-x86_64-pc-windows-msvc mod.js
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,34 @@

## Quick Start

`hyper-copy` is a standalone executable to copy documents from a source [hyper `Data` `Service`](https://docs.hyper.io/docs/api-reference/rest/data.html) to a target [hyper `Data` `Service`](https://docs.hyper.io/docs/api-reference/rest/data.html). `hyper-copy` is great for copying data across hyper `Data` `Services` without having to interact with the underlying tech powering the service, the power of [Ports and Adapters](https://docs.hyper.io/docs/concepts/clean-cloud-architecture.html).

> First, make sure you've
> [created your destination hyper `Data` `Service`](https://docs.hyper.io/docs/api-reference/rest/data.html#create-a-data-service)
```sh
# Linux
curl -O https://hyperland.s3.amazonaws.com/hyper-copy

# Apple x86_64
curl -O https://hyperland.s3.amazonaws.com/hyper-copy-x86_64-apple-darwin

# Apple aarch64 (M1)
curl -O https://hyperland.s3.amazonaws.com/hyper-copy-aarch64-apple-darwin

# Windows
curl -O https://hyperland.s3.amazonaws.com/hyper-copy-x86_64-pc-windows-msvc.exe

# Make it executable if needed
chmod +x hyper-copy

# Copy your documents
hyper-copy [SRC_CONNECTION_STRING] [TARGET_CONNECTION_STRING]
```

`hyper-copy` will copy documents from `SRC_CONNECTION_STRING` to `TARGET_CONNECTION_STRING`, `1000`
at a time, until all documents have been copied.

## Requirements

- Linux x64 Environment

> If there is interest in creating binaries for other enviroments, please submit an issue.
## Example

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Copy documents from one hyper Data Service to another hyper Data Service",
"tasks": {
"cache": "deno cache --lock=deno.lock --lock-write ./deps.js",
"compile": "deno compile --allow-net --unstable --no-check --output hyper-copy mod.js",
"compile": "make clean compile-linux compile-apple compile-arch-apple compile-windows",
"prepare": "deno run -A --no-lock npm:husky@^9",
"staged": "deno run -A --no-lock npm:lint-staged@^15",
"test": "deno lint && deno test --no-lock -A"
Expand Down

0 comments on commit 968e951

Please sign in to comment.