Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ AKASH_DEVCACHE_VERSIONS=${AKASH_DEVCACHE}/versions
AKASH_DEVCACHE_NODE_MODULES=${AKASH_DEVCACHE}
AKASH_DEVCACHE_NODE_BIN=${AKASH_DEVCACHE_NODE_MODULES}/node_modules/.bin
AKASH_RUN=${AKASH_DEVCACHE}/run
AKASH_RUN_BIN=${AKASH_RUN}/bin
84 changes: 57 additions & 27 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,102 @@ direnv_version_major=$(direnv version | cut -d "." -f1 | tr -d '\n')
direnv_version_minor=$(direnv version | cut -d "." -f2 | tr -d '\n')

if [[ $direnv_version_major -lt 2 ]] || [[ $direnv_version_major -eq 2 ]] && [[ $direnv_version_minor -lt 32 ]]; then
echo -e "\033[31munsupported direnv version $(direnv version) < 2.32.x"
exit 1
echo -e "\033[31munsupported direnv version $(direnv version) < 2.32.x"
exit 1
fi

if [[ "$SHELL" == "bash" ]]; then
if [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
echo -e "\033[31mthe environment needs BASH 4 or above" >&2
exit 1
fi
if [[ "$(ps -p "$$" -o 'comm=')" =~ "bash" ]]; then
if [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
echo -e "\033[31mthe environment needs BASH 4 or above" >&2
exit 1
fi
fi

if ! has make ; then
echo "make is not installed"; exit 1
if ! has make; then
echo "make is not installed"
exit 1
fi

if ! has unzip ; then
echo "unzip is not installed"; exit 1
if ! has unzip; then
echo "unzip is not installed"
exit 1
fi

if ! has wget ; then
echo "wget is not installed"; exit 1
if ! has wget; then
echo "wget is not installed"
exit 1
fi

if ! has curl ; then
echo "curl is not installed"; exit 1
if ! has curl; then
echo "curl is not installed"
exit 1
fi

if ! has npm ; then
echo "npm is not installed"; exit 1
if ! has npm; then
echo "npm is not installed"
exit 1
fi

if ! has jq ; then
echo "jq is not installed"; exit 1
if ! has jq; then
echo "jq is not installed"
exit 1
fi

if ! has readlink ; then
echo "readlink is not installed"; exit 1
if ! has readlink; then
echo "readlink is not installed"
exit 1
fi

if ! has pv; then
echo "pv is not installed"
exit 1
fi

if ! has lz4; then
echo "lz4 is not installed"
exit 1
fi

if [ -z "$GOPATH" ]; then
GOPATH=$(go env GOPATH)
export GOPATH
GOPATH=$(go env GOPATH)
export GOPATH
fi

AKASH_ROOT=$(pwd)
export AKASH_ROOT

dotenv
dotenv_if_exists dev.env

TOOLS=${AKASH_ROOT}/script/tools.sh
SEMVER=${AKASH_ROOT}/script/semver.sh

GOTOOLCHAIN=$(${TOOLS} gotoolchain)
GOTOOLCHAIN_SEMVER=$(echo "${GOTOOLCHAIN}" | sed 's/go*/v/' | tr -d '\n')

dotenv_if_exists dev.env

if [[ ${GOWORK} != "off" ]] && [[ -f go.work ]]; then
GOWORK=${AKASH_ROOT}/go.work
else
GOWORK=off
fi

if [[ "$OSTYPE" == "darwin"* ]]; then
# on MacOS disable deprecation warnings security framework
CGO_CFLAGS=-Wno-deprecated-declarations
# on MacOS disable deprecation warnings security framework
CGO_CFLAGS=-Wno-deprecated-declarations

export CGO_CFLAGS
fi

export CGO_CFLAGS
if [ -z "${GOARCH}" ]; then
GOARCH=$(go env GOARCH)
export GOARCH
fi

export SEMVER
export GOTOOLCHAIN
export GOTOOLCHAIN_SEMVER
export GOWORK

PATH_add "$AKASH_DEVCACHE_NODE_BIN"
PATH_add "$AKASH_DEVCACHE_BIN"
Expand Down
1 change: 1 addition & 0 deletions .github/.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github.com/akash-network/node
38 changes: 38 additions & 0 deletions .github/actions/setup-ubuntu/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: setup-ubuntu
runs:
using: 'composite'
steps:
- name: Fetch all tags
shell: bash
run: |
if git rev-parse --is-shallow-repository | grep -qxF true; then
git fetch --prune --unshallow
else
git fetch --prune --tags
fi
- name: Install dependencies
# Shell must explicitly specify the shell for each step. https://github.com/orgs/community/discussions/18597
shell: bash
run: sudo apt install -y make direnv unzip lz4 wget curl npm jq pv coreutils
- name: Setup npm
uses: actions/setup-node@v4
with:
node-version: 18
- name: Detect required Go version
shell: bash
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/^go//')
if [ -z "$toolchain" ]; then
echo "Error: Failed to detect Go version from script/tools.sh" >&2
exit 1
fi
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
check-latest: true
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
with:
masks: ''
2 changes: 1 addition & 1 deletion .github/workflows/concommits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: webiny/action-conventional-commits@v1.1.0
- uses: webiny/action-conventional-commits@v1.3.0
44 changes: 20 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ on:

jobs:
publish:
runs-on: ubuntu-latest
runs-on: core-e2e
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Detect required Go version
- name: Cleanup build folder
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
sudo rm -rf ./* || true
sudo rm -rf ./.??* || true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-ubuntu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -37,40 +34,39 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Make and publish
run: |
sudo rm -rf dist
sudo rm -rf .cache/goreleaser
make release
env:
GORELEASER_RELEASE: true
GORELEASER_MOUNT_CONFIG: true
# using PAT as homebrew is located in different repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test-network-upgrade-on-release:
runs-on: upgrade-tester
runs-on: gh-runner-test
needs:
- publish
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Detect required Go version
- name: Cleanup build folder
run: |
toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//')
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GOVERSION }}"
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
sudo rm -rf ./* || true
sudo rm -rf ./.??* || true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-ubuntu
- name: detect release tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: configure variables
run: |
test_required=$(./script/upgrades.sh test-required ${{ env.RELEASE_TAG }})
echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV
- name: run test
id: test
if: env.TEST_REQUIRED != ''
env:
UPGRADE_BINARY_VERSION: ${{ env.RELEASE_TAG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_CONFIG: test-config-gha.json
run: |
cd tests/upgrade
make test
Expand All @@ -80,7 +76,7 @@ jobs:
with:
name: logs
path: |
.cache/run/upgrade/validators/logs/*.log
.cache/run/upgrade/validators/logs/.akash*.log

notify-homebrew:
runs-on: ubuntu-latest
Expand Down
Loading
Loading