Skip to content

Commit

Permalink
Merge pull request #185 from skalenetwork/enhancement/npm-te-encrypt-…
Browse files Browse the repository at this point in the history
…package#177

create npm package for threshold encryption on publish#177
  • Loading branch information
olehnikolaiev authored May 11, 2022
2 parents f35bc5b + d48e33e commit 605ee50
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 139 deletions.
51 changes: 49 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'

- name: Update apt
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test; sudo apt-get update
- name: Install packages
Expand All @@ -45,26 +51,51 @@ jobs:
cd deps
./build.sh
- name: Configure all
- name: Configure
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
mkdir -p build && cd build
cmake ..
- name: Build all
- name: Build
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd build
make -j$(nproc)
- name: Build dependencies wasm
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd deps
./clean.sh
./build.sh WITH_EMSCRIPTEN=1
cd ..
- name: Build wasm
run: |
cd deps/emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ../..
mkdir -p build_em && cd build_em
export LIBRARIES_ROOT=../deps/deps_inst/x86_or_x64/lib
emcmake cmake -DEMSCRIPTEN=ON .. -DGMP_LIBRARY="$LIBRARIES_ROOT"/libgmp.a -DCRYPTOPP_LIBRARY="$LIBRARIES_ROOT"/libcrypto.a -DGMPXX_LIBRARY="$LIBRARIES_ROOT"/libgmpxx.a
emmake make -j$(nproc)
cd ..
cp build_em/threshold_encryption/encrypt.js node/
- name: Calculate version
run: |
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
echo "::set-env name=BRANCH::$BRANCH"
export VERSION=$(cat VERSION.txt)
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION)
echo "::set-env name=VERSION::$VERSION"
Expand All @@ -74,6 +105,22 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- name: Publish on npm
if: github.ref != 'refs/heads/stable'
run: |
cd node
npm version --no-git-tag-version ${{ env.VERSION }}
npm publish --access public --tag ${{ env.BRANCH }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish on npm (stable)
if: github.ref == 'refs/heads/stable'
run: |
cd node
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ jobs:
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
cd deps
./build.sh WITH_EMSCRIPTEN=1
cd ..
Expand Down
44 changes: 0 additions & 44 deletions node/encryptTransaction.html

This file was deleted.

55 changes: 0 additions & 55 deletions node/encryptTransaction.js

This file was deleted.

32 changes: 20 additions & 12 deletions node/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
{
"name": "encryptte-test",
"version": "1.0.0",
"dependencies": {
"@babel/core": "^7.13.8",
"babel-core": "6.26.3",
"babel-loader": "8.1.0",
"web3": "1.3.0",
"webpack": "4.43.0"
},
"devDependencies": {
"webpack-cli": "^3.3.6"
}
"name": "@skalenetwork/t-encrypt",
"version": "0.1.0",
"keywords": [
"SKALE",
"blockchain",
"ethereum",
"threshold",
"cryptography",
"encryption"
],
"homepage": "https://github.com/skalenetwork/libBLS",
"license": "AGPL-3.0",
"author": "SKALE Labs and contributors",
"publishConfig": {
"access": "public"
},
"scripts": {
"version": "node -e \"console.log(require('./package.json').version);\""
}
}

25 changes: 0 additions & 25 deletions node/webpack.config.js

This file was deleted.

0 comments on commit 605ee50

Please sign in to comment.