diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index dc1acc152..02a5fc02b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -42,4 +42,4 @@ jobs: uses: docker/build-push-action@v4 with: push: true - tags: nethermind/warp:${{ github.event.release.tag_name }} + tags: nethermind/warp:latest,nethermind/warp:${{ github.event.release.tag_name }} diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 000000000..aea47aef1 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const WARP_ROOT = path.resolve(path.dirname(__dirname)); diff --git a/src/warplib/gatherWarplibImports.ts b/src/warplib/gatherWarplibImports.ts index 3c7d5bc58..b3af5c52b 100644 --- a/src/warplib/gatherWarplibImports.ts +++ b/src/warplib/gatherWarplibImports.ts @@ -2,16 +2,20 @@ import fs from 'fs'; import { Implicits } from '../utils/implicits'; import { parseMultipleRawCairoFunctions } from '../utils/cairoParsing'; import { glob } from 'glob'; +import path from 'path'; + +import { WARP_ROOT } from '../config'; export const warplibImportInfo = glob - .sync('warplib/**/*.cairo') + .sync(path.join(WARP_ROOT, 'warplib/**/*.cairo')) .reduce((warplibMap, pathToFile) => { const rawCairoCode = fs.readFileSync(pathToFile, { encoding: 'utf8' }); - const importPath = pathToFile + const importPath = path + .relative(WARP_ROOT, pathToFile) .split('/') .join('.') - .slice(0, pathToFile.length - '.cairo'.length); + .slice(0, -'.cairo'.length); const fileMap: Map = warplibMap.get(importPath) ?? new Map();