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

0.1.3 pre-release changes #29

Merged
merged 14 commits into from
Dec 12, 2024
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
76 changes: 38 additions & 38 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml

name: release
name: Release

on:
workflow_dispatch:
Expand All @@ -16,6 +16,9 @@ jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

Expand All @@ -30,7 +33,6 @@ jobs:
run: |
echo "version is: $VERSION"
- name: Check that tag version and Cargo.toml version are the same
shell: bash
run: |
VERSION=${VERSION#v} # strip leading v if present only for the Cargo.toml check
if ! grep -q "version = \"$VERSION\"" Cargo.toml; then
Expand All @@ -47,9 +49,12 @@ jobs:
release_name: ${{ env.RELEASE_NAME }}

build-release:
name: build-release
name: ${{ matrix.build }}
needs: ['create-release']
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
Expand All @@ -68,48 +73,55 @@ jobs:
PCRE2_SYS_STATIC: 1
# To ensure openssl is static linked
OPENSSL_STATIC: 1
# Build static
RUSTFLAGS: "-C target-feature=+crt-static"
strategy:
fail-fast: false
matrix:
include:
- build: stable-x86
- build: ubuntu-x86
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
qemu: i386
- build: stable-aarch64
os: ubuntu-latest
# - build: ubuntu-aarch64
# os: ubuntu-latest
# rust: stable
# target: aarch64-unknown-linux-gnu
# strip: aarch64-linux-gnu-strip
- build: macos-x86
os: macos-latest
rust: stable
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-latest
rust: stable
target: aarch64-unknown-linux-gnu
strip: aarch64-linux-gnu-strip
qemu: qemu-aarch64
# - build: macos
# os: macos-latest
# rust: nightly
# target: x86_64-apple-darwin
# - build: win-msvc
# os: windows-latest
# rust: nightly
# target: x86_64-pc-windows-msvc
target: aarch64-apple-darwin

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |-
sudo apt-get update
sudo apt-get install -y openssl ca-certificates pkg-config cmake libssl-dev

- name: Install packages (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install openssl pkg-config cmake

- name: Install buf
if: matrix.os == 'ubuntu-latest'
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}

- name: Install Protoc
if: matrix.os == 'ubuntu-latest'
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ github.token }}

- name: Install Rust
uses: dtolnay/rust-toolchain@master
Expand All @@ -118,8 +130,8 @@ jobs:
target: ${{ matrix.target }}

- name: Use Cross
if: matrix.os == 'ubuntu-latest' && matrix.target != ''
shell: bash
# Build without Cross for native target
if: matrix.os == 'ubuntu-latest' && matrix.target != 'x86_64-unknown-linux-gnu'
run: |
# In the past, new releases of 'cross' have broken CI. So for now, we
# pin it. We also use their pre-compiled binary releases because cross
Expand All @@ -133,22 +145,17 @@ jobs:
echo "CARGO=cross" >> $GITHUB_ENV

- name: Set target variables
shell: bash
run: |
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV

- name: Show command used for Cargo
shell: bash
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"

- name: Build release binary
shell: bash
run: |
${{ env.CARGO }} build --bin gvltctl --verbose --release ${{ env.TARGET_FLAGS }}
${{ env.CARGO }} build --bin gvltctl --verbose --release --features openssl-vendored ${{ env.TARGET_FLAGS }}
if [ "${{ matrix.os }}" = "windows-latest" ]; then
bin="target/${{ matrix.target }}/release/gvltctl.exe"
else
Expand All @@ -158,12 +165,10 @@ jobs:

- name: Strip release binary (macos)
if: matrix.os == 'macos-latest'
shell: bash
run: strip "$BIN"

- name: Strip release binary (cross)
if: env.CARGO == 'cross' && matrix.strip != ''
shell: bash
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
Expand All @@ -173,24 +178,21 @@ jobs:

- name: Strip release binary (native strip)
if: matrix.os != 'macos-latest' && matrix.strip == ''
shell: bash
run: strip "$BIN"

- name: Determine archive name
shell: bash
run: |
version="${{ needs.create-release.outputs.version }}"
echo "ARCHIVE=gvltctl-${{ matrix.target }}" >> $GITHUB_ENV

- name: Creating directory for archive
shell: bash
run: |
mkdir -p "$ARCHIVE"
cp "$BIN" "$ARCHIVE"/
cp README.md "$ARCHIVE"/
cp LICENSE* "$ARCHIVE"/

- name: Build archive (Windows)
shell: bash
if: matrix.os == 'windows-latest'
run: |
7z a "$ARCHIVE.zip" "$ARCHIVE"
Expand All @@ -199,7 +201,6 @@ jobs:
echo "ASSET_SUM=$ARCHIVE.zip.sha256" >> $GITHUB_ENV

- name: Build archive (Unix)
shell: bash
if: matrix.os != 'windows-latest'
run: |
tar czf "$ARCHIVE.tar.gz" "$ARCHIVE"
Expand All @@ -210,7 +211,6 @@ jobs:
- name: Upload release archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
release_name="v${{ needs.create-release.outputs.version }}"
release_name="${{ needs.create-release.outputs.version }}"
gh release upload "$release_name" ${{ env.ASSET }} ${{ env.ASSET_SUM }}
22 changes: 17 additions & 5 deletions Cargo.lock

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

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
[package]
name = "gvltctl"
version = "0.1.2"
version = "0.1.3-pre"
edition = "2021"
authors = ["Gevulot Team"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/gevulotnetwork/gvltctl"
description = "Gevulot Control CLI"

[dependencies]
# TODO: change rev to tag when available
# NOTE: this revision is aligned with `mia-installer` dependency.
# Be careful changing it.
gevulot-rs = { git = "https://github.com/gevulotnetwork/gevulot-rs.git", rev = "e972c7c73a88182d22121a995f01abed04dff106" }
gevulot-rs = "0.1.3-pre.3"

bip32 = "0.5.1"
clap = { version = "4", features = ["env", "cargo"] }
Expand All @@ -24,9 +21,14 @@ serde_json = "1"
serde_yaml = "0.9.34"
tokio = { version = "1", features = ["full"] }
toml = "0.8.19"
openssl = { version = "*", optional = true }

[features]
# This feature should be enabled when building static executable
openssl-vendored = ["openssl/vendored"]

[target.'cfg(target_os = "linux")'.dependencies]
mia-installer = { git = "https://github.com/gevulotnetwork/mia.git", tag = "mia-installer-0.2.4"}
mia-installer = { git = "https://github.com/gevulotnetwork/mia.git", tag = "mia-installer-0.2.5"}

anyhow = "1"
log = "0.4.22"
Expand Down
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,70 @@
# gvltctl
# Gevulot Control CLI

This tool is used to interact with Gevulot Network.

## Installation

### Pre-built releases

You can download pre-built release binaries from [releases](https://github.com/gevulotnetwork/gvltctl/releases):

Supported platforms:

- `x86_64-unknown-linux-gnu`
- `x86_64-apple-darwin`
- `aarch64-apple-darwin`

#### Installation of pre-built release

1. Download archive

```shell
curl -fLO https://github.com/gevulotnetwork/gvltctl/releases/download/${VERSION}/gvltctl-${PLATFORM}.tar.gz
```

2. (Optional) Verify checksum

```shell
curl -fLO https://github.com/gevulotnetwork/gvltctl/releases/download/${VERSION}/gvltctl-${PLATFORM}.tar.gz.sha256
sha256sum -c gvltctl-${PLATFORM}.tar.gz.sha256
```

3. Install the binary

```shell
tar xf gvltctl-${PLATFORM}.tar.gz
cp gvltctl-${PLATFORM}/gvltctl $HOME/.local/bin
```

### Compiling from sources

```shell
cargo install --git https://github.com/gevulotnetwork/gvltctl.git --tag $VERSION
```

## Usage

```shell
$ gvltctl --help
Gevulot Control CLI

Usage: gvltctl <COMMAND>

Commands:
worker Commands related to workers
pin Commands related to pins
task Commands related to tasks
workflow Commands related to workflows
keygen Generate a new key
compute-key Compute a key
send Send tokens to a receiver on the Gevulot network
account-info Get the balance of the given account
generate-completion Generate shell completion scripts
sudo Perform administrative operations with sudo privileges
build Build a VM image from a container, rootfs directory, or Containerfile
help Print this message or the help of the given subcommand(s)

Options:
-h, --help Print help
-V, --version Print version
```
Loading