From 42cd1979531d2510b253e79bcd5d3c39beee5dee Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:06:58 +0000 Subject: [PATCH] fix(publish): ensure we commit unstaged files first --- .github/workflows/e2e.yml | 7 ++++++- .github/workflows/release.yml | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a317ba8d87..8d82e77c6c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [master, dev] + branches: [dev] pull_request: env: @@ -43,6 +43,11 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" + # Depending on the STATE_TREE_DEPTH param, there + # might be changes in the EmptyBallotRoots.sol file + git add contracts/contracts/trees/EmptyBallotRoots.sol + git diff --staged --quiet || git commit -m "Commit changes before publishing" + lerna version 0.0.0-ci.$(git rev-parse --short HEAD) --no-push --yes lerna publish from-git --dist-tag ci --yes env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8a0f5ec95..868c443c2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,11 @@ jobs: - name: Publish NPM run: | + # Depending on the STATE_TREE_DEPTH param, there + # might be changes in the EmptyBallotRoots.sol file + git add contracts/contracts/trees/EmptyBallotRoots.sol + git diff --staged --quiet || git commit -m "Commit changes before publishing" + npx lerna publish from-git --yes env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}