Skip to content

Commit

Permalink
Merge pull request #1727 from skalenetwork/beta
Browse files Browse the repository at this point in the history
Prepare 2.2.0 release candidate
  • Loading branch information
yavrsky authored Nov 20, 2024
2 parents 2402652 + 346a8b9 commit 029fff7
Show file tree
Hide file tree
Showing 236 changed files with 9,309 additions and 12,584 deletions.
4 changes: 3 additions & 1 deletion proxy/.eslintrc.cjs → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = {

},
ignorePatterns: [

"coverage/**",
"typechain-types/**",
"**/venv/**"
]
};
69 changes: 0 additions & 69 deletions .eslintrc.js

This file was deleted.

10 changes: 10 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

if [[ $(npx cspell -- --no-summary $1 2> /dev/null) ]]
then
echo "It looks like you have spell-checking errors in your commit message."
npx cspell -- --no-summary $1
exit 1
fi
17 changes: 17 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# cSpell:words gpgsign

set -e

GPG_SIGN_ENABLED=$(git config commit.gpgsign || true)
if ! [[ "$GPG_SIGN_ENABLED" == "true" ]]
then
echo "Enable GPG signature for new commits";
exit 1;
fi

files=$(git diff --cached --name-only)
npx cspell -- --no-summary $files

yarn fullCheck
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @DimaStebaev @DmytroNazarenko
*.md @skalenetwork/docowners
16 changes: 9 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/proxy"
schedule:
interval: "weekly"
day: "saturday"
allow:
- dependency-type: "production"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/scripts/"
schedule:
interval: "weekly"
3 changes: 2 additions & 1 deletion .github/workflows/issue_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
check-linked-issues:
name: Check if pull request has linked issues
if: ${{ !startsWith(github.head_ref, 'dependabot/') }}
runs-on: ubuntu-latest
steps:
- name: Get issues
Expand All @@ -15,5 +16,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: PR has not linked issues
if: join(steps.get-issues.outputs.issues) == ''
run:
run:
exit 1
153 changes: 76 additions & 77 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Build and publish
name: publish

# cspell:words PYPI_TOKEN ncipollo

on:
pull_request:
Expand All @@ -7,98 +9,90 @@ on:
- 'v*.*.*'
- develop
- beta
- release-candidate
- stable
push:
tags:
- 'custom-release-*'

env:
NODE_VERSION: 18
PYTHON_VERSION: 3.8

jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true

if: github.event_name != 'pull_request' || github.event.pull_request.merged == true

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
PROXY_DIR: "proxy"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
outputs:
version: ${{ steps.version.outputs.version }}

- uses: actions/cache@v2
steps:
- uses: actions/checkout@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
submodules: recursive

- name: Install NODE JS
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'

- name: Install Python 3.8
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: predeployed/test/requirements.txt

- name: Prepare for pip package building
run: |
python3 -m pip install --upgrade build
python3 -m pip install --user --upgrade twine
- name: Install project
working-directory: ${{env.PROXY_DIR}}
run: |
yarn install
run: yarn install

- name: Calculate version
id: version
run: |
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(bash ./scripts/calculate_version.sh)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Version $VERSION"
( test $BRANCH = "stable" && export PRERELEASE=false ) || export PRERELEASE=true
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
- name: Generate Manifest
working-directory: ${{env.PROXY_DIR}}
run: |
npx hardhat run migrations/generateManifest.ts
run: npx hardhat run migrations/generateManifest.ts

- name: Install python testing staff
working-directory: ${{env.PROXY_DIR}}
run: pip3 install -r predeployed/test/requirements.txt

- name: Build predeployed pip package
working-directory: ${{env.PROXY_DIR}}
env:
VERSION: ${{ env.VERSION }}
run: |
./predeployed/scripts/build_package.sh
run: ./predeployed/scripts/build_package.sh

- name: Publish predeployed pip package
working-directory: ${{env.PROXY_DIR}}
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
./predeployed/scripts/publish_package.sh
run: ./predeployed/scripts/publish_package.sh

- name: Generate mainnet ABIs
env:
VERSION: ${{ env.VERSION }}
run: npx hardhat run scripts/generateAbi.ts

- name: Generate ABIs
working-directory: ${{env.PROXY_DIR}}/predeployed
- name: Generate predeployed ABIs
working-directory: predeployed
env:
VERSION: ${{ env.VERSION }}
run: |
Expand All @@ -108,47 +102,52 @@ jobs:
mkdir data
python scripts/generate_abi.py > data/ima-$VERSION-predeployed-abi.json
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: ${{ env.PRERELEASE }}

- name: Upload Release Assets
id: upload-release-assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/predeployed/dist/
name: data
path: data

- name: Upload Release Assets
id: upload-static-data
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/predeployed/data/

- name: Upload Release Assets
id: upload-manifest-data
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/data/ima-schain-*-manifest.json
tag: ${{ env.VERSION }}
commit: ${{ github.sha }}
prerelease: ${{ env.PRERELEASE }}
artifacts: "predeployed/dist/*,\
predeployed/data/*,\
data/ima-schain-*-manifest.json,\
data/*-abi.json"

- name: Build and publish image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: scripts/build_and_publish_image.sh

abi:
runs-on: ubuntu-latest

needs:
build

env:
VERSION: ${{ needs.build.outputs.version }}

steps:
- uses: actions/checkout@v4
with:
ref: abi

- name: Load artifacts
uses: actions/download-artifact@v4
with:
name: data

- name: Commit ABI
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "Add ABI for version ${{ env.VERSION }}"
add: "*-abi.json"
Loading

0 comments on commit 029fff7

Please sign in to comment.