Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version hyper-nano binaries and place artifacts in the current working directory #600

Merged
merged 3 commits into from
May 30, 2023
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
9 changes: 7 additions & 2 deletions .github/workflows/image-nano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
- name: 🛠 Build Executables
run: |
cd images/nano

export VER=$(node -e "console.log(require('./package.json').version)")
echo "binary version: $VER"
make clean compile-linux compile-apple compile-arch-apple compile-windows
env:
CI: true
Expand All @@ -70,8 +73,10 @@ jobs:
- name: 🗄 Upload Executables to S3
run: |
cd images/nano
echo "aliasing linux binary to 'hyper'"
cp ./build/hyper-x86_64-unknown-linux-gnu ./build/hyper
echo "aliasing latest linux binary to 'hyper'"
export VER=$(node -e "console.log(require('./package.json').version)")
echo "binary version: $VER"
cp ./build/hyper-x86_64-unknown-linux-gnu-$VER ./build/hyper
echo "copying binaries to hyperland s3 ⚡️"
aws s3 cp --acl public-read --recursive ./build s3://hyperland

Expand Down
20 changes: 16 additions & 4 deletions images/nano/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@ clean:
@rm -rf ./build

compile-linux:
@deno compile --target=x86_64-unknown-linux-gnu --allow-sys --allow-env --allow-read --allow-write=__hyper__,/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-unknown-linux-gnu mod.js
@deno compile --target=x86_64-unknown-linux-gnu \
--allow-sys --allow-env --allow-read --allow-write=__hyper__ --allow-net \
--unstable --no-check=remote \
--output ./build/hyper-x86_64-unknown-linux-gnu-$(VER) mod.js

compile-apple:
@deno compile --target=x86_64-apple-darwin --allow-sys --allow-env --allow-read --allow-write=__hyper__,/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-apple-darwin mod.js
@deno compile --target=x86_64-apple-darwin \
--allow-sys --allow-env --allow-read --allow-write=__hyper__ --allow-net \
--unstable --no-check=remote \
--output ./build/hyper-x86_64-apple-darwin-$(VER) mod.js

compile-arch-apple:
@deno compile --target=aarch64-apple-darwin --allow-sys --allow-env --allow-read --allow-write=__hyper__,/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-aarch64-apple-darwin mod.js
@deno compile --target=aarch64-apple-darwin \
--allow-sys --allow-env --allow-read --allow-write=__hyper__ --allow-net \
--unstable --no-check=remote \
--output ./build/hyper-aarch64-apple-darwin-$(VER) mod.js

compile-windows:
@deno compile --target=x86_64-pc-windows-msvc --allow-sys --allow-env --allow-read --allow-write=__hyper__,/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-pc-windows-msvc mod.js
@deno compile --target=x86_64-pc-windows-msvc \
--allow-sys --allow-env --allow-read --allow-write=__hyper__ --allow-net \
--unstable --no-check=remote \
--output ./build/hyper-x86_64-pc-windows-msvc-$(VER) mod.js
12 changes: 7 additions & 5 deletions images/nano/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ const { dirname, join } = require('path')
const chalk = require('chalk')
const ora = require('ora')

const destDir = join(dirname(__filename))
const { version } = require('../package.json')

const destDir = join(dirname('.'))
const binaryDest = join(destDir, 'hyper-nano')

function getBinary() {
const binaries = {
linux: 'hyper-x86_64-unknown-linux-gnu',
win32: 'hyper-x86_64-pc-windows-msvc.exe',
darwinx86_64: 'hyper-x86_64-apple-darwin',
darwinarm64: 'hyper-aarch64-apple-darwin',
linux: `hyper-x86_64-unknown-linux-gnu-${version}`,
win32: `hyper-x86_64-pc-windows-msvc-${version}.exe`,
darwinx86_64: `hyper-x86_64-apple-darwin-${version}`,
darwinarm64: `hyper-aarch64-apple-darwin-${version}`,
}

const os = platform()
Expand Down
26 changes: 13 additions & 13 deletions images/nano/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.