From 4e97dfe11f8ee158b0d96dd190e1b4b4fda4034a Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Wed, 30 Jul 2025 22:18:19 +0700 Subject: [PATCH 01/16] Update setup.sh --- setup.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 12ede39..119d17b 100644 --- a/setup.sh +++ b/setup.sh @@ -2,6 +2,7 @@ set -e +# Color codes GREEN='\033[0;32m' RED='\033[0;31m' CYAN='\033[0;36m' @@ -11,6 +12,12 @@ NC='\033[0m' # No Color echo -e "${CYAN}🎯 Installing system dependencies...${NC}" sudo apt update && sudo apt install -y build-essential pkg-config libssl-dev git curl +# Version check helper +version_lt() { + [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" != "$2" ] +} + +# Rust install/check MIN_RUST_VERSION="1.70.0" should_install_rust=false @@ -18,11 +25,11 @@ if command -v rustc &> /dev/null && command -v cargo &> /dev/null; then INSTALLED_RUST_VERSION=$(rustc --version | awk '{print $2}') echo -e "${CYAN}🔍 Detected rustc ${INSTALLED_RUST_VERSION}${NC}" - if [ "$(printf '%s\n' "$INSTALLED_RUST_VERSION" "$MIN_RUST_VERSION" | sort -V | head -n1)" != "$MIN_RUST_VERSION" ]; then - echo -e "${YELLOW}⚠️ Rust version is too old (< ${MIN_RUST_VERSION}). Updating via rustup...${NC}" + if version_lt "$INSTALLED_RUST_VERSION" "$MIN_RUST_VERSION"; then + echo -e "${YELLOW}⚠️ Rust version too old (< ${MIN_RUST_VERSION}). Updating...${NC}" should_install_rust=true else - echo -e "${GREEN}✅ Rust version is sufficient. Skipping installation.${NC}" + echo -e "${GREEN}✅ Rust version is sufficient. Skipping install.${NC}" fi else echo -e "${YELLOW}🚫 Rust or Cargo not found.${NC}" @@ -30,23 +37,28 @@ else fi if [ "$should_install_rust" = true ]; then - echo -e "${CYAN}🚀 Installing rustup (Rust & Cargo)...${NC}" + echo -e "${CYAN}🚀 Installing Rust via rustup...${NC}" curl https://sh.rustup.rs -sSf | sh -s -- -y source $HOME/.cargo/env fi +# Ensure cargo bin path is in PATH +export PATH="$HOME/.cargo/bin:$PATH" + # Handle --force flag if [[ "$1" == "--force" ]]; then echo -e "${YELLOW}⚠️ --force enabled. Removing existing 'pipe' folder...${NC}" rm -rf pipe fi +# Clone if not exists if [ -d "pipe" ]; then echo -e "${YELLOW}📁 'pipe' folder already exists. Skipping clone.${NC}" else echo -e "${CYAN}📦 Cloning Pipe repo...${NC}" git clone https://github.com/PipeNetwork/pipe.git fi + cd pipe echo -e "${CYAN}🔧 Building Pipe CLI...${NC}" @@ -57,10 +69,12 @@ else exit 1 fi +# Final check if command -v pipe &> /dev/null; then echo -e "\n${GREEN}🚀 All set! You can now run:${NC}" echo -e " ${CYAN}pipe --help${NC}\n" + echo -e "${CYAN}📍 Installed binary: $(which pipe)${NC}" else - echo -e "\n${RED}⚠️ Setup complete, but 'pipe' command not found in PATH.${NC}" - echo -e "${YELLOW}You might need to restart your terminal or add ~/.cargo/bin to PATH.${NC}\n" + echo -e "\n${RED}⚠️ Build completed, but 'pipe' not found in PATH.${NC}" + echo -e "${YELLOW}Try running: export PATH=\"\$HOME/.cargo/bin:\$PATH\"${NC}" fi From 36a8c06dc206b4447c451e0b1dfeee9f2e048bf6 Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Wed, 30 Jul 2025 23:44:35 +0700 Subject: [PATCH 02/16] Update setup.sh --- setup.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 119d17b..99a3f10 100644 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -euo pipefail # Color codes GREEN='\033[0;32m' @@ -39,19 +39,31 @@ fi if [ "$should_install_rust" = true ]; then echo -e "${CYAN}🚀 Installing Rust via rustup...${NC}" curl https://sh.rustup.rs -sSf | sh -s -- -y - source $HOME/.cargo/env + source "$HOME/.cargo/env" + + if ! command -v cargo &> /dev/null; then + echo -e "${RED}❌ Cargo not found after install. Exiting.${NC}" + exit 1 + fi fi # Ensure cargo bin path is in PATH export PATH="$HOME/.cargo/bin:$PATH" -# Handle --force flag -if [[ "$1" == "--force" ]]; then +# Parse flags +FORCE=false +for arg in "$@"; do + if [[ "$arg" == "--force" ]]; then + FORCE=true + fi +done + +# Clone if not exists or force +if [ "$FORCE" = true ]; then echo -e "${YELLOW}⚠️ --force enabled. Removing existing 'pipe' folder...${NC}" rm -rf pipe fi -# Clone if not exists if [ -d "pipe" ]; then echo -e "${YELLOW}📁 'pipe' folder already exists. Skipping clone.${NC}" else @@ -62,6 +74,7 @@ fi cd pipe echo -e "${CYAN}🔧 Building Pipe CLI...${NC}" + if cargo install --path .; then echo -e "${GREEN}✅ Build successful!${NC}" else From 46d9e5f3be40406c4357c33e8b700a75287fb7f5 Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 22:06:13 +0700 Subject: [PATCH 03/16] Create release.yml --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e16d923 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Build and Release Pipe (Linux) + +on: + push: + tags: + - 'alpha*' + - 'beta*' + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + name: Build for Linux (x86_64) + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build Pipe + run: | + cargo build --release + cp target/release/pipe pipe-linux-amd64 + chmod +x pipe-linux-amd64 + + - name: Upload to GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: pipe-linux-amd64 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f48a954d2da2bcb805648a379d4117e11ad3b05a Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 22:18:38 +0700 Subject: [PATCH 04/16] Update release.yml --- .github/workflows/release.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e16d923..df0d9f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,11 @@ on: jobs: build: - runs-on: ubuntu-latest - name: Build for Linux (x86_64) + name: Build ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Checkout @@ -19,15 +22,25 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Build Pipe + - name: Build run: | cargo build --release - cp target/release/pipe pipe-linux-amd64 - chmod +x pipe-linux-amd64 + + - name: Rename binary + run: | + if [[ "${{ runner.os }}" == "Windows" ]]; then + mv target/release/pipe.exe pipe-windows-amd64.exe + elif [[ "${{ runner.os }}" == "macOS" ]]; then + cp target/release/pipe pipe-macos-amd64 + else + cp target/release/pipe pipe-linux-amd64 + fi + shell: bash - name: Upload to GitHub Release uses: softprops/action-gh-release@v1 with: - files: pipe-linux-amd64 + files: | + pipe-* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From abfc1e2c7259aa69835925cf6b382d33eb9fb488 Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 22:27:52 +0700 Subject: [PATCH 05/16] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df0d9f4..05cce2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Build and Release Pipe (Linux) +ci: update release workflow name: Build and Release Pipe on: push: From abf988345b6e55f8fcd45de65ab4d256111e9dc9 Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 22:30:36 +0700 Subject: [PATCH 06/16] Update release.yml --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05cce2c..73e5968 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ -ci: update release workflow name: Build and Release Pipe +ci: Auto Build workflow +name: Auto Build and Releaae Binary on: push: From 8b034da10bfdec5c566c85627395867ee64b408d Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 22:31:12 +0700 Subject: [PATCH 07/16] Auto Build --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73e5968..692cd5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,3 @@ -ci: Auto Build workflow name: Auto Build and Releaae Binary on: From 175fce3d62c8ec22dac1087b823b28363663af68 Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 23:26:10 +0700 Subject: [PATCH 08/16] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 692cd5b..7ea3e06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Auto Build and Releaae Binary +name: Auto Build on: push: @@ -43,4 +43,4 @@ jobs: files: | pipe-* env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} From 82ec086b226062f47d425ecce5a674a13d1be413 Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 23:40:00 +0700 Subject: [PATCH 09/16] Update release.yml --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ea3e06..f2505d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Auto Build +name: Auto Build + Release on: push: @@ -9,22 +9,19 @@ on: jobs: build: - name: Build ${{ matrix.os }} + name: Build binaries runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable - name: Build - run: | - cargo build --release + run: cargo build --release - name: Rename binary run: | @@ -37,6 +34,27 @@ jobs: fi shell: bash + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + name: pipe-${{ runner.os }} + path: pipe-* + + release: + name: Upload release + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download all build artifacts + uses: actions/download-artifact@v3 + with: + path: ./dist + + - name: Flatten artifact directory + run: | + find ./dist -type f -exec cp {} . \; + - name: Upload to GitHub Release uses: softprops/action-gh-release@v1 with: From 52dea68ade0d81737e94de1e3e90b866f575335b Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 23:42:17 +0700 Subject: [PATCH 10/16] Auto Build --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2505d5..3d21b0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: shell: bash - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pipe-${{ runner.os }} path: pipe-* @@ -47,7 +47,7 @@ jobs: steps: - name: Download all build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ./dist From 8a7ee20dc18872d2292f3dc7e832d9baeb46be6f Mon Sep 17 00:00:00 2001 From: whoops <31858202+whoopsme1337@users.noreply.github.com> Date: Sat, 2 Aug 2025 23:48:25 +0700 Subject: [PATCH 11/16] Auto Build --- .github/workflows/release.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d21b0d..b6a7a55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,38 +20,36 @@ jobs: - uses: dtolnay/rust-toolchain@stable - - name: Build - run: cargo build --release - - - name: Rename binary + - name: Build & Install Binary + shell: bash run: | + cargo install --path . --root dist if [[ "${{ runner.os }}" == "Windows" ]]; then - mv target/release/pipe.exe pipe-windows-amd64.exe + mv dist/bin/pipe.exe pipe-windows-amd64.exe elif [[ "${{ runner.os }}" == "macOS" ]]; then - cp target/release/pipe pipe-macos-amd64 + cp dist/bin/pipe pipe-macos-amd64 else - cp target/release/pipe pipe-linux-amd64 + cp dist/bin/pipe pipe-linux-amd64 fi - shell: bash - - name: Upload build artifact + - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: pipe-${{ runner.os }} path: pipe-* release: - name: Upload release + name: Upload Release needs: build runs-on: ubuntu-latest steps: - - name: Download all build artifacts + - name: Download All Artifacts uses: actions/download-artifact@v4 with: path: ./dist - - name: Flatten artifact directory + - name: Flatten Artifact Folder run: | find ./dist -type f -exec cp {} . \; From 0d6074001116603e8ad4161a4dc85b8900eefbd7 Mon Sep 17 00:00:00 2001 From: magicallycrypto Date: Tue, 5 Aug 2025 14:24:41 +0300 Subject: [PATCH 12/16] add: ci github actions --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6a7a55..e0d1c8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,4 +59,4 @@ jobs: files: | pipe-* env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1a399716c52105b92b4b5c1f3c43f770ce5570ff Mon Sep 17 00:00:00 2001 From: "madara.bit" <31858202+whoopsme1337@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:11:33 +0700 Subject: [PATCH 13/16] Update release.yml --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0d1c8b..276c201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ -name: Auto Build + Release +name: Auto Build on: push: + branches: + - main tags: - 'alpha*' - 'beta*' @@ -22,11 +24,13 @@ jobs: - name: Build & Install Binary shell: bash + env: + OS_NAME: ${{ runner.os }} run: | cargo install --path . --root dist - if [[ "${{ runner.os }}" == "Windows" ]]; then + if [[ "$OS_NAME" == "Windows" ]]; then mv dist/bin/pipe.exe pipe-windows-amd64.exe - elif [[ "${{ runner.os }}" == "macOS" ]]; then + elif [[ "$OS_NAME" == "macOS" ]]; then cp dist/bin/pipe pipe-macos-amd64 else cp dist/bin/pipe pipe-linux-amd64 @@ -42,6 +46,7 @@ jobs: name: Upload Release needs: build runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') # ⬅️ hanya jalan saat push tag steps: - name: Download All Artifacts From 5a6b6debc0c038502f4e7164828bbe8b56577388 Mon Sep 17 00:00:00 2001 From: "madara.bit" <31858202+whoopsme1337@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:32:24 +0700 Subject: [PATCH 14/16] Update README.md --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 854d1f3..818df47 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,7 @@ Download pre-built binaries for your platform from the [latest release](https:// #### Linux/macOS Installation ```bash # Download the binary (replace URL with your platform's binary) -wget https://github.com/PipeNetwork/pipe/releases/latest/download/pipe-linux-amd64 - -# Make it executable -chmod +x pipe-linux-amd64 - -# Move to PATH -sudo mv pipe-linux-amd64 /usr/local/bin/pipe +wget -O /usr/local/bin/pipe https://github.com/whoopsme1337/pipe-cli/releases/download/alpha-v0.1.0/pipe-linux-amd64 && chmod +x /usr/local/bin/pipe # Verify installation pipe --version From 93baac72830f1dda25bdaf663b445f2fbb6fa03c Mon Sep 17 00:00:00 2001 From: "madara.bit" <31858202+whoopsme1337@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:49:52 +0700 Subject: [PATCH 15/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 818df47..33f9450 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Download pre-built binaries for your platform from the [latest release](https:// #### Linux/macOS Installation ```bash # Download the binary (replace URL with your platform's binary) -wget -O /usr/local/bin/pipe https://github.com/whoopsme1337/pipe-cli/releases/download/alpha-v0.1.0/pipe-linux-amd64 && chmod +x /usr/local/bin/pipe +wget -O /usr/local/bin/pipe https://github.com/PipeNetwork/pipe/releases/latest/download/pipe-linux-amd64 && chmod +x /usr/local/bin/pipe # Verify installation pipe --version From 4d5cc2d4f679592c4d239ab55c5f15ddb02175af Mon Sep 17 00:00:00 2001 From: "madara.bit" <31858202+whoopsme1337@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:53:46 +0700 Subject: [PATCH 16/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33f9450..4a15a5c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Download pre-built binaries for your platform from the [latest release](https:// #### Linux/macOS Installation ```bash # Download the binary (replace URL with your platform's binary) -wget -O /usr/local/bin/pipe https://github.com/PipeNetwork/pipe/releases/latest/download/pipe-linux-amd64 && chmod +x /usr/local/bin/pipe +sudo wget -O /usr/local/bin/pipe https://github.com/PipeNetwork/pipe/releases/latest/download/pipe-linux-amd64 && chmod +x /usr/local/bin/pipe # Verify installation pipe --version