Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Dockerhub latest tag & absolute warplib path #1076

Merged
merged 5 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import path from 'path';

export const WARP_ROOT = path.resolve(path.dirname(__dirname));
10 changes: 7 additions & 3 deletions src/warplib/gatherWarplibImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Implicits[]> =
warplibMap.get(importPath) ?? new Map<string, Implicits[]>();
Expand Down