forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEarthfile
42 lines (35 loc) · 1.22 KB
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
VERSION 0.8
src:
FROM ../build-images+from-registry
WORKDIR /usr/src/l1-contracts
COPY --dir lib src terraform test *.json *.toml *.sh .
DO ../build-system/s3-cache-scripts/+WRITE_CONTENT_HASH --rebuild_patterns=".rebuild_patterns"
lint:
FROM +src
RUN solhint --config ./.solhint.json "src/**/*.sol"
RUN forge clean && forge fmt --check
build:
FROM +lint
WORKDIR /usr/src/l1-contracts
DO ../build-system/s3-cache-scripts/+WITH_CACHE \
--prefix="l1-contracts" \
--rebuild_patterns=".rebuild_patterns" \
--command="forge build" \
--build_artifacts="out"
SAVE ARTIFACT /usr/src/l1-contracts /usr/src/l1-contracts
test:
FROM +build
RUN forge test --no-match-contract UniswapPortalTest
publish-npm:
FROM +build
ARG VERSION
ARG DIST_TAG
ARG DRY_RUN=0
WORKDIR /usr/src/l1-contracts
RUN --secret NPM_TOKEN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
RUN jq --arg v $VERSION '.version = $v' package.json > _tmp.json && mv _tmp.json package.json
RUN if [ "$DRY_RUN" = "1" ]; then \
npm publish --tag $DIST_TAG --access public --dry-run; \
else \
npm publish --tag $DIST_TAG --access public; \
fi