build tooling (#69)
* script/macos:add * script/linux:add libx11-dev * Cargo.toml:pin nostr nostr-sdk nostr nostr-connect --------- Co-authored-by: reya <123083837+reyamir@users.noreply.github.com>
This commit is contained in:
30
.github/workflows/rust.yml
vendored
Normal file
30
.github/workflows/rust.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Rust
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "**" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "m**" ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
rustup: [stable, nightly]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: script/linux
|
||||||
|
run: chmod +x ./script/linux && ./script/linux
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
#- name: cargo update
|
||||||
|
# run: cargo update
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --verbose
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test --verbose
|
||||||
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -3601,6 +3601,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
|
|||||||
name = "nostr"
|
name = "nostr"
|
||||||
version = "0.42.1"
|
version = "0.42.1"
|
||||||
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"base64",
|
"base64",
|
||||||
@@ -3612,6 +3613,7 @@ dependencies = [
|
|||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
"getrandom 0.2.16",
|
"getrandom 0.2.16",
|
||||||
"instant",
|
"instant",
|
||||||
|
"regex",
|
||||||
"reqwest 0.12.20",
|
"reqwest 0.12.20",
|
||||||
"scrypt",
|
"scrypt",
|
||||||
"secp256k1",
|
"secp256k1",
|
||||||
@@ -3625,6 +3627,7 @@ dependencies = [
|
|||||||
name = "nostr-connect"
|
name = "nostr-connect"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-utility",
|
"async-utility",
|
||||||
"nostr",
|
"nostr",
|
||||||
@@ -3637,6 +3640,7 @@ dependencies = [
|
|||||||
name = "nostr-database"
|
name = "nostr-database"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"flatbuffers",
|
"flatbuffers",
|
||||||
"lru",
|
"lru",
|
||||||
@@ -3648,6 +3652,7 @@ dependencies = [
|
|||||||
name = "nostr-lmdb"
|
name = "nostr-lmdb"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-utility",
|
"async-utility",
|
||||||
"heed",
|
"heed",
|
||||||
@@ -3661,6 +3666,7 @@ dependencies = [
|
|||||||
name = "nostr-relay-pool"
|
name = "nostr-relay-pool"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-utility",
|
"async-utility",
|
||||||
"async-wsocket",
|
"async-wsocket",
|
||||||
@@ -3677,6 +3683,7 @@ dependencies = [
|
|||||||
name = "nostr-sdk"
|
name = "nostr-sdk"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
source = "git+https://github.com/rust-nostr/nostr#ecf711ee9f3bca83c2a31a1de0f2977cd2845af5"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-utility",
|
"async-utility",
|
||||||
"nostr",
|
"nostr",
|
||||||
@@ -3684,6 +3691,7 @@ dependencies = [
|
|||||||
"nostr-lmdb",
|
"nostr-lmdb",
|
||||||
"nostr-relay-pool",
|
"nostr-relay-pool",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
[toolchain]
|
|
||||||
channel = "1.87"
|
|
||||||
profile = "minimal"
|
|
||||||
components = ["rustfmt", "clippy"]
|
|
||||||
targets = [
|
|
||||||
"x86_64-apple-darwin",
|
|
||||||
"aarch64-apple-darwin",
|
|
||||||
"x86_64-unknown-linux-gnu",
|
|
||||||
"x86_64-pc-windows-msvc",
|
|
||||||
]
|
|
||||||
@@ -34,6 +34,7 @@ if [[ -n $apt ]]; then
|
|||||||
libzstd-dev
|
libzstd-dev
|
||||||
libvulkan1
|
libvulkan1
|
||||||
libgit2-dev
|
libgit2-dev
|
||||||
|
libx11-dev
|
||||||
make
|
make
|
||||||
cmake
|
cmake
|
||||||
clang
|
clang
|
||||||
|
|||||||
51
script/macos
Executable file
51
script/macos
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -xeuo pipefail
|
||||||
|
|
||||||
|
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||||
|
|
||||||
|
# if root or if sudo/unavailable, define an empty variable
|
||||||
|
if [ "$(id -u)" -eq 0 ]
|
||||||
|
then maysudo=''
|
||||||
|
else maysudo="$(command -v sudo || command -v doas || true)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
function finalize {
|
||||||
|
# after packages install (curl, etc), get the rust toolchain
|
||||||
|
which rustup > /dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
# verify the mold situation
|
||||||
|
if ! command -v mold >/dev/null 2>&1; then
|
||||||
|
echo "Warning: Mold binaries are unavailable on your system." >&2
|
||||||
|
echo " Builds will be slower without mold. Try: script/install-mold" >&2
|
||||||
|
fi
|
||||||
|
echo "Finished installing MacOS dependencies with script/macos"
|
||||||
|
}
|
||||||
|
|
||||||
|
# MacOS
|
||||||
|
brew=$(command -v brew || true)
|
||||||
|
if [[ -n $brew ]]; then
|
||||||
|
deps=(
|
||||||
|
gcc
|
||||||
|
libx11
|
||||||
|
libxkbcommon
|
||||||
|
openssl
|
||||||
|
zstd
|
||||||
|
vulkan-headers
|
||||||
|
libgit2
|
||||||
|
libx11
|
||||||
|
make
|
||||||
|
cmake
|
||||||
|
jq
|
||||||
|
git
|
||||||
|
curl
|
||||||
|
gettext
|
||||||
|
)
|
||||||
|
|
||||||
|
$brew update
|
||||||
|
for dep in "${deps[@]}";do
|
||||||
|
$brew search "$dep";
|
||||||
|
done
|
||||||
|
$brew install "${deps[@]}"
|
||||||
|
finalize
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user