diff --git a/.github/workflows/publish-aztec-packages.yml b/.github/workflows/publish-aztec-packages.yml index ad2d5b355d3..1206673b3af 100644 --- a/.github/workflows/publish-aztec-packages.yml +++ b/.github/workflows/publish-aztec-packages.yml @@ -287,6 +287,18 @@ jobs: --VERSION=$VERSION \ --DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }} + - name: Publish l1-contracts NPM package + run: | + DEPLOY_TAG=${{ env.DEPLOY_TAG }} + VERSION=${DEPLOY_TAG#aztec-packages-v + earthly-ci \ + --no-output \ + --secret NPM_TOKEN=${{ env.NPM_TOKEN }} \ + ./l1-contracts+publish-npm \ + --DIST_TAG=latest \ + --VERSION=$VERSION \ + --DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }} + - name: Publish bb.js NPM package run: | DEPLOY_TAG=${{ env.DEPLOY_TAG }} diff --git a/l1-contracts/Earthfile b/l1-contracts/Earthfile index 144caa09c90..f8932184cfe 100644 --- a/l1-contracts/Earthfile +++ b/l1-contracts/Earthfile @@ -26,3 +26,17 @@ build: test: FROM +build RUN forge test --no-match-contract UniswapPortalTest + +publish-npm: + FROM +build + ARG VERSION + ARG DIST_TAG + ARG DRY_RUN=0 + RUN --secret NPM_TOKEN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > /usr/src/barretenberg/ts/.npmrc + WORKDIR /usr/src/l1-contracts + 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