From 56ba85e9463e2c7716684bfa5c86a03ade9b08d8 Mon Sep 17 00:00:00 2001 From: David Racero Date: Tue, 26 Jan 2021 12:56:36 +0100 Subject: [PATCH] Add publish to Gitlab CI --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ package.json | 48 +++++++++++++++++++++--------------------------- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b012440d..4274147d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,10 @@ stages: - checks + - prepare + - publish + +variables: + IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} test: stage: checks @@ -40,3 +45,24 @@ certora-test: - certoraRun specs/harness/StableDebtTokenHarness.sol:StableDebtTokenHarness --solc_args "['--optimize']" --verify StableDebtTokenHarness:specs/StableDebtToken.spec --settings -assumeUnwindCond,-b=4 --cache StableDebtToken --cloud - certoraRun specs/harness/UserConfigurationHarness.sol --verify UserConfigurationHarness:specs/UserConfiguration.spec --solc_args "['--optimize']" --settings -useBitVectorTheory --cache UserConfiguration --cloud - certoraRun contracts/protocol/tokenization/VariableDebtToken.sol:VariableDebtToken specs/harness/LendingPoolHarnessForVariableDebtToken.sol --solc_args "['--optimize']" --link VariableDebtToken:POOL=LendingPoolHarnessForVariableDebtToken --verify VariableDebtToken:specs/VariableDebtToken.spec --settings -assumeUnwindCond,-useNonLinearArithmetic,-b=4 --cache VariableDebtToken --cloud + +prepare: + stage: prepare + tags: + - docker-builder + script: + - docker build -t ${IMAGE} . + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY + - docker push ${IMAGE} + only: + - master + +publish: + extends: .image_step + stage: publish + script: + - npm ci + - echo //registry.npmjs.org/:_authToken=${NPM_V2_PACKAGES_TOKEN} > .npmrc + - npm run compile + - ${VERSION} + - npm publish --access public diff --git a/package.json b/package.json index 4fefea1b..ea016bca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,11 @@ { - "name": "protocol-v2", + "name": "@aave/protocol-v2", "version": "1.0.0", "description": "Aave Protocol V2 smart contracts", + "files": [ + "contracts", + "artifacts" + ], "scripts": { "run-env": "npm i && tail -f /dev/null", "hardhat": "hardhat", @@ -62,7 +66,8 @@ "main:initialize-tokens": "npm run compile && hardhat --network main full:initialize-tokens --pool Aave", "kovan:initialize-tokens": "npm run compile && hardhat --network kovan full:initialize-tokens --pool Aave", "external:deploy-assets-kovan": "npm run compile && hardhat --network kovan external:deploy-new-asset --symbol ${SYMBOL} --verify", - "external:deploy-assets-main": "npm run compile && hardhat --network main external:deploy-new-asset --symbol ${SYMBOL} --verify" + "external:deploy-assets-main": "npm run compile && hardhat --network main external:deploy-new-asset --symbol ${SYMBOL} --verify", + "prepublishOnly": "npm run compile" }, "devDependencies": { "@nomiclabs/buidler": "^1.4.7", @@ -118,33 +123,22 @@ }, "author": "Aave", "contributors": [ - { - "name": "Emilio Frangella", - "email": "emilio@aave.com" - }, - { - "name": "Ernesto Boado", - "email": "ernesto@aave.com" - }, - { - "name": "Andrey Kozlov", - "email": "andrey@aave.com" - }, - { - "name": "David Racero", - "email": "david.k@aave.com" - }, - { - "name": "Pol Sendra", - "email": "pol@aave.com" - }, - { - "name": "David Truong", - "email": "david@aave.com" - } + "Ernesto Boado ", + "Emilio Frangella ", + "Andrey Kozlov ", + "David Racero ", + "Pol Sendra ", + "David Truong " ], "license": "AGPLv3", "dependencies": { "tmp-promise": "^3.0.2" - } + }, + "keywords": [ + "aave", + "protocol", + "protocol-v2", + "ethereum", + "solidity" + ] }