Skip to content

Commit 205a364

Browse files
ci: Run prepublishOnly script during release (#3576)
Co-authored-by: Abhijeet Prasad <[email protected]>
1 parent b024902 commit 205a364

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ jobs:
7676
# this file) to a constant and skip rebuilding all of the packages each time CI runs.
7777
if: steps.cache_built_packages.outputs.cache-hit == ''
7878
run: yarn build
79+
# We are performing a `prepublishOnly` step manually because build workflow is not responsible for publishing
80+
# the actual release. It only creates artifacts which then are uploaded and used by another workflow.
81+
# Because of that, any `prepublishOnly` script is skipped and files it produces are not included in the tarball.
82+
# We also cannot use `prepare` script which would be more suited, because it's run only before `pack` is called,
83+
# and it's done from a `release` workflow and not here.
84+
- name: Run prepublishOnly script
85+
if: startsWith(github.ref, 'refs/heads/release/')
86+
run: yarn prepublishOnly
7987
outputs:
8088
# this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on
8189
# `job_build` can't see `job_install_deps` and what it returned)

0 commit comments

Comments
 (0)