Skip to content

Commit

Permalink
Merge branch 'KYAN-develop' of https://github.com/decenomy/DSW
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed Nov 19, 2024
2 parents c148f5c + 863c46e commit 57c0f50
Show file tree
Hide file tree
Showing 77 changed files with 2,008 additions and 1,104 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build-files-linux-x64:
runs-on: [self-hosted, Linux, X64]
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
Expand All @@ -17,12 +17,15 @@ jobs:
run: |
# Extract the name of the repository and use it as the ticker value
REPO_NAME="${GITHUB_REPOSITORY##*/}"
# Extract the name of the repository owner and use it as the github user
ACCOUNT_NAME="${GITHUB_REPOSITORY%/*}"
# Get the short name of the ref (strip 'refs/heads/', 'refs/tags/', etc.)
SHORT_REF=${GITHUB_REF##*/}
# Get the short commit hash
SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)
# Set environment variables
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
echo "ACCOUNT_NAME=${ACCOUNT_NAME}" >> $GITHUB_ENV
echo "SHORT_REF=${SHORT_REF}" >> $GITHUB_ENV
echo "IMAGE_NAME=linux-x64-build-img-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
echo "CONTAINER_NAME=linux-x64-build-ctn-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
Expand All @@ -40,6 +43,7 @@ jobs:
--build-arg NAME=Kyanite \
--build-arg BASE_NAME=kyanite \
--build-arg TARGET=$SHORT_REF \
--build-arg GITHUB_USER=$ACCOUNT_NAME \
-t ${IMAGE_NAME} \
-f contrib/docker/Dockerfile.dsw-linux-x64-wallet .
Expand All @@ -50,7 +54,7 @@ jobs:
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp ${CONTAINER_NAME}:/$REPO_NAME/deploy/linux-x64 release_files/
docker cp ${CONTAINER_NAME}:/$ACCOUNT_NAME/$REPO_NAME/deploy/linux-x64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v4
Expand All @@ -66,7 +70,7 @@ jobs:
docker rmi ${IMAGE_NAME}
build-files-linux-arm64:
runs-on: [self-hosted, Linux, X64]
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
Expand All @@ -76,12 +80,15 @@ jobs:
run: |
# Extract the name of the repository and use it as the ticker value
REPO_NAME="${GITHUB_REPOSITORY##*/}"
# Extract the name of the repository owner and use it as the github user
ACCOUNT_NAME="${GITHUB_REPOSITORY%/*}"
# Get the short name of the ref (strip 'refs/heads/', 'refs/tags/', etc.)
SHORT_REF=${GITHUB_REF##*/}
# Get the short commit hash
SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)
# Set environment variables
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
echo "ACCOUNT_NAME=${ACCOUNT_NAME}" >> $GITHUB_ENV
echo "SHORT_REF=${SHORT_REF}" >> $GITHUB_ENV
echo "IMAGE_NAME=linux-arm64-build-img-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
echo "CONTAINER_NAME=linux-arm64-build-ctn-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
Expand All @@ -99,6 +106,7 @@ jobs:
--build-arg NAME=Kyanite \
--build-arg BASE_NAME=kyanite \
--build-arg TARGET=$SHORT_REF \
--build-arg GITHUB_USER=$ACCOUNT_NAME \
-t ${IMAGE_NAME} \
-f contrib/docker/Dockerfile.dsw-linux-arm64-wallet .
Expand All @@ -109,7 +117,7 @@ jobs:
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp ${CONTAINER_NAME}:/$REPO_NAME/deploy/linux-arm64 release_files/
docker cp ${CONTAINER_NAME}:/$ACCOUNT_NAME/$REPO_NAME/deploy/linux-arm64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v4
Expand All @@ -125,7 +133,7 @@ jobs:
docker rmi ${IMAGE_NAME}
build-windows-x64:
runs-on: [self-hosted, Linux, X64]
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
Expand All @@ -135,12 +143,15 @@ jobs:
run: |
# Extract the name of the repository and use it as the ticker value
REPO_NAME="${GITHUB_REPOSITORY##*/}"
# Extract the name of the repository owner and use it as the github user
ACCOUNT_NAME="${GITHUB_REPOSITORY%/*}"
# Get the short name of the ref (strip 'refs/heads/', 'refs/tags/', etc.)
SHORT_REF=${GITHUB_REF##*/}
# Get the short commit hash
SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)
# Set environment variables
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
echo "ACCOUNT_NAME=${ACCOUNT_NAME}" >> $GITHUB_ENV
echo "SHORT_REF=${SHORT_REF}" >> $GITHUB_ENV
echo "IMAGE_NAME=windows-x64-build-img-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
echo "CONTAINER_NAME=windows-x64-build-ctn-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
Expand All @@ -158,6 +169,7 @@ jobs:
--build-arg NAME=Kyanite \
--build-arg BASE_NAME=kyanite \
--build-arg TARGET=$SHORT_REF \
--build-arg GITHUB_USER=$ACCOUNT_NAME \
-t ${IMAGE_NAME} \
-f contrib/docker/Dockerfile.dsw-windows-x64-wallet .
Expand All @@ -168,7 +180,7 @@ jobs:
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp ${CONTAINER_NAME}:/$REPO_NAME/deploy/windows-x64 release_files/
docker cp ${CONTAINER_NAME}:/$ACCOUNT_NAME/$REPO_NAME/deploy/windows-x64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v4
Expand All @@ -184,7 +196,7 @@ jobs:
docker rmi ${IMAGE_NAME}
build-macos-x64:
runs-on: [self-hosted, Linux, X64]
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
Expand All @@ -194,12 +206,15 @@ jobs:
run: |
# Extract the name of the repository and use it as the ticker value
REPO_NAME="${GITHUB_REPOSITORY##*/}"
# Extract the name of the repository owner and use it as the github user
ACCOUNT_NAME="${GITHUB_REPOSITORY%/*}"
# Get the short name of the ref (strip 'refs/heads/', 'refs/tags/', etc.)
SHORT_REF=${GITHUB_REF##*/}
# Get the short commit hash
SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)
# Set environment variables
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
echo "ACCOUNT_NAME=${ACCOUNT_NAME}" >> $GITHUB_ENV
echo "SHORT_REF=${SHORT_REF}" >> $GITHUB_ENV
echo "IMAGE_NAME=macos-x64-build-img-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
echo "CONTAINER_NAME=macos-x64-build-ctn-${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
Expand All @@ -217,6 +232,7 @@ jobs:
--build-arg NAME=Kyanite \
--build-arg BASE_NAME=kyanite \
--build-arg TARGET=$SHORT_REF \
--build-arg GITHUB_USER=$ACCOUNT_NAME \
-t ${IMAGE_NAME} \
-f contrib/docker/Dockerfile.dsw-macos-x64-wallet .
Expand All @@ -227,7 +243,7 @@ jobs:
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp ${CONTAINER_NAME}:/$REPO_NAME/deploy/macos-x64 release_files/
docker cp ${CONTAINER_NAME}:/$ACCOUNT_NAME/$REPO_NAME/deploy/macos-x64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline {
rm -rf SDKs
mkdir SDKs
cd SDKs
wget -c https://github.com/decenomy/depends/raw/main/SDKs/MacOSX10.11.sdk.tar.xz
wget -c https://ipfs.decenomy.net/QmccbpJcugkoV6uVovYsyZ3MPxGTcbUNYXMhLQL2hLzHwH -O MacOSX10.11.sdk.tar.xz
tar -xf MacOSX10.11.sdk.tar.xz
cd ..
make -j $(nproc) HOST=x86_64-apple-darwin14
Expand Down
24 changes: 18 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,26 @@ CPU_CORES=${CPU_CORES:-""}
# windows-x64
ARCHITECTURE=${ARCHITECTURE:-""}

# Get the origin URL
ORIGIN_URL=$(git config --get remote.origin.url)

# Extract the github username and repository name
if [[ $ORIGIN_URL =~ ^https://github.com/(.+)/(.+)\.git$ ]]; then
GITHUB_USER="${BASH_REMATCH[1]}"
GITHUB_REPO="${BASH_REMATCH[2]}"
elif [[ $ORIGIN_URL =~ ^[email protected]:(.+)/(.+)\.git$ ]]; then
GITHUB_USER="${BASH_REMATCH[1]}"
GITHUB_REPO="${BASH_REMATCH[2]}"
else
echo "Unable to parse origin URL: $ORIGIN_URL"
exit 1
fi

# Sets variables needed for the build
TICKER=${TICKER:-"KYAN"}
TICKER=${TICKER:-"${GITHUB_REPO}"}
UI_NAME=${UI_NAME:-"Kyanite"}
BASE_NAME=${BASE_NAME:-"kyanite"}

# Sets the github environment variables
GITHUB_USER="decenomy"
GITHUB_REPO="KYAN"

# Sets the build environment variable
# 0: The build will use the builder image available on docker hub
# 1: The build will use a locally build image for the builder image
Expand Down Expand Up @@ -227,6 +238,7 @@ docker buildx build \
--build-arg NAME=$UI_NAME \
--build-arg BASE_NAME=$BASE_NAME \
--build-arg TARGET=$TARGET \
--build-arg GITHUB_USER=$GITHUB_USER \
-f $WALLET_DOCKER_FILE.tmp \
-t $image_tag \
.
Expand All @@ -246,7 +258,7 @@ trace "Container ID: $container_id"
# Copy files from the container to the current directory
mkdir -p deploy
rm -rf deploy/$ARCHITECTURE
docker cp "$container_id":/${TICKER}/deploy/. ./deploy/
docker cp "$container_id":/${GITHUB_USER}/${TICKER}/deploy/. ./deploy/

# Main verification process
if [ "$VERIFY" -ge 1 ]; then
Expand Down
33 changes: 33 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
kyanite:
image: ubuntu:24.04
container_name: kyanite-ctn
restart: always
ports:
- "__PORT_MAINNET__:__PORT_MAINNET__" # TCP mainnet port
- "__RPCPORT_MAINNET__:__RPCPORT_MAINNET__" # RPC mainnet port
volumes:
- ${HOME}/.kyanite:/root/.kyanite:shared
command:
- bash
- -c
- |
if [ ! -f /usr/local/bin/kyanited ]; then
echo "Kyanite binary not found, setting up environment..."
apt-get update && \
apt-get install -y wget curl unzip && \
rm -rf /var/lib/apt/lists/* && \
echo $(curl -s https://api.github.com/repos/decenomy/KYAN/releases/latest | grep "browser_download_url" | grep -E "Linux(-x64)?\.zip" | cut -d '"' -f 4) > latest_release_url && \
echo "Latest release URL: $(cat latest_release_url)" && \
echo $(basename "$(cat latest_release_url)") > latest_filename && \
echo "Latest filename: $(cat latest_filename)" && \
wget "$(cat latest_release_url)" && \
unzip -q "$(cat latest_filename)" && \
rm "$(cat latest_filename)" && \
rm latest_filename && \
rm latest_release_url && \
mv kyanite* /usr/local/bin;
else
echo "Kyanite binary already installed, skipping setup."
fi
kyanited
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 6)
define(_CLIENT_VERSION_REVISION, 7)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
Loading

0 comments on commit 57c0f50

Please sign in to comment.