Skip to content

Commit

Permalink
fix: publish l1-contracts on NPM (#10029)
Browse files Browse the repository at this point in the history
  • Loading branch information
spypsy authored Nov 19, 2024
1 parent 58761fc commit d2d7334
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/publish-aztec-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
14 changes: 14 additions & 0 deletions l1-contracts/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d2d7334

Please sign in to comment.