From 5b10c4a6087eb02f96fea53dd94359097c0fcd7b Mon Sep 17 00:00:00 2001 From: Marco Vidal Garcia Date: Mon, 18 Sep 2023 12:25:17 +0200 Subject: [PATCH] ci: add build step to publish workflow - ensure building packages in the right order - prevent lerna from running prepublish script --- .github/workflows/publish.yml | 11 ++++++++++- packages/orbit-tailwind-preset/package.json | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ab36dfb09..bdbbe2e88c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,6 +29,15 @@ jobs: git config user.name "mainframev" git config user.email "vgenaev@gmail.com" + - name: Build + run: | + # we need to build packages in the right order + # lerna won't run build due to --ignore-prepublish flag + yarn tokens build + yarn tailwind-preset build + yarn components build + yarn workspace @kiwicom/eslint-plugin-orbit-components build + - name: Dry run if: ${{ github.event.inputs.dryrun == 'true' }} run: | @@ -46,7 +55,7 @@ jobs: echo "access=public" >> ~/.npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc echo "//registry.npmjs.org/:always-auth=true" >> ~/.npmrc - yarn lerna publish --no-private --conventional-commits --create-release github --yes + yarn lerna publish --no-private --conventional-commits --create-release github --ignore-prepublish --yes yarn docs changelog git add docs/src/data/log.md && git commit -m "docs: update changelog" && git push yarn zx scripts/post-changelog.mjs diff --git a/packages/orbit-tailwind-preset/package.json b/packages/orbit-tailwind-preset/package.json index 979cc6703c..d6ff4a30e9 100644 --- a/packages/orbit-tailwind-preset/package.json +++ b/packages/orbit-tailwind-preset/package.json @@ -26,6 +26,7 @@ ], "scripts": { "build": "yarn tsup", + "prepublishOnly": "yarn build", "pretest": "yarn workspace @kiwicom/orbit-design-tokens build && yarn build && yarn tailwindcss -o style.css", "test": "jest" },