diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c35d2f0..ea9e286 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,10 @@ on: - stable - beta - develop + push: + tags: + - 'custom-release-*' + env: NODE_VERSION: 18 PYTHON_VERSION: 3.11 diff --git a/cspell.json b/cspell.json index f858410..c7ffd3b 100644 --- a/cspell.json +++ b/cspell.json @@ -9,7 +9,8 @@ "**/node_modules/**", "**/__pycache__/**", "**/requirements.txt", - "**/*.egg-info/**" + "**/*.egg-info/**", + "**/lib/**" ], "dictionaries": ["domain-terms", "libraries", "names", "skale-terms", "solidity"], "dictionaryDefinitions": [ diff --git a/typescript/base/.eslintrc.cjs b/typescript/base/.eslintrc.cjs index 741db2a..70a084c 100644 --- a/typescript/base/.eslintrc.cjs +++ b/typescript/base/.eslintrc.cjs @@ -1,20 +1,40 @@ /* eslint-env node */ module.exports = { - extends: [ - 'eslint:all', - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended' + "extends": [ + "eslint:all", + "eslint:recommended", + "plugin:@typescript-eslint/recommended" ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - root: true, - rules: { - "object-curly-spacing": [ "error", "always" ], - "padded-blocks": [ "error", "never" ], - "one-var": ["error", "never"] - }, - ignorePatterns: [ + "ignorePatterns": [ "lib/**", "debug.ts" - ] - }; + ], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "root": true, + "rules": { + "capitalized-comments": [ + "error", + "always", + { + "ignoreConsecutiveComments": true + } + ], + "multiline-comment-style": [ + "error", + "separate-lines" + ], + "object-curly-spacing": [ + "error", + "always" + ], + "one-var": [ + "error", + "never" + ], + "padded-blocks": [ + "error", + "never" + ] + } +}; diff --git a/typescript/base/src/project.ts b/typescript/base/src/project.ts index c4992ae..f77af47 100644 --- a/typescript/base/src/project.ts +++ b/typescript/base/src/project.ts @@ -33,13 +33,30 @@ export abstract class Project { } async downloadAbiFile (version: string) { - const response = await axios.get(this.getAbiUrl(version)); - return response.data as SkaleABIFile; + const exceptions = []; + for (const abiUrl of this.getAbiUrls(version)) { + try { + // Await expression should be executed only + // when it failed on the previous iteration + // eslint-disable-next-line no-await-in-loop + const response = await axios.get(abiUrl); + return response.data as SkaleABIFile; + } catch (exception) { + exceptions.push(exception); + } + } + throw new Error(exceptions.toString()); } - getAbiUrl (version: string) { - return `${this.githubRepo}releases/download/` + - `${version}/${this.getAbiFilename(version)}`; + getAbiUrls (version: string) { + return [ + `${this.githubRepo}releases/download/` + + `${version}/${this.getAbiFilename(version)}`, + `${this.githubRepo.replace( + "github.com", + "raw.githubusercontent.com" + )}abi/${this.getAbiFilename(version)}` + ]; } abstract getAbiFilename(version: string): string;