-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add reusable workflow for upload and download build artifacts in actions #2000
ci: add reusable workflow for upload and download build artifacts in actions #2000
Conversation
…ackages from artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very very cool!
npm_token: ${{ secrets.npm_token }} | ||
- name: Build | ||
shell: bash | ||
run: yarn lerna run build --since=origin/master --include-dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is relevant only for branches that aren't master, maybe we can emphasis it somehow so no one will use it for master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep :)
#2006 does exactly that and I will update all of our workflows once it is merged, including this new build-and-upload workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you wrote in the PR's description: "Call the reusable action of download-builds instead the previous yarn lerna run build ... step"
Are we cool with that happening also for the lint steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it is happening in like 2-3s so we're cool with it
description: Download build artifacts for all the packages and extract them to the correct location | ||
|
||
runs: | ||
using: "composite" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this action is composite and the second one isn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the build and upload can be a job of its own (reusable workflow)
reusable action is a step
that encapsulates multiple steps
reusable workflow is a job
that encapsulates multiple jobs
the reason I chose going with a reusable workflow for the build-and-upload
is that in case we need the build, I'm saving the consumer from doing checkout
and setup
. the consumer can just do:
build:
name: Build
uses: ./.github/workflows/build-and-upload.yml
secrets:
npm_token: ${{ secrets.npm_token }}
if the build-and-upload
was a reusable action (composite
), it would have looked like this:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Setup
uses: ./.github/actions/setup
with:
npm_token: ${{secrets.npm_token}}
- name: Run Build
shell: bash
run: yarn lerna run build --since=origin/master --include-dependencies
in probably 100% of the cases where consumers would need the build, they would just want it to happen, they don't need to interfere what happens with it
https://monday.monday.com/boards/3532714909/pulses/6212333840
TL;DR:
build-and-upload
as first job in your workflowdownload-builds
instead the previousyarn lerna run build ...
step@shaharzil Add your
storybook-blocks
to the.github/workflows/build-and-upload.yml
file underpath
.An example usage to call the build and upload is as following:
After this you'll have an artifact that includes all the
packages/*/dist
for the current workflow run idAnd you need to state that the rest of the jobs cannot run in parallel, and they
needs
the build step to succeed. an example:And instead of building inside jobs, you can now call the workflows.
Old:
New: