-
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
Changes from all commits
6755e64
cbcded9
8a35c65
0f99852
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Download and Extract Build Artifacts | ||
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 commentThe 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 commentThe 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) the reason I chose going with a reusable workflow for the
if the
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 |
||
steps: | ||
- name: Download and Extract | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }} | ||
path: packages/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build and Upload Artifacts | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
npm_token: | ||
required: true | ||
|
||
jobs: | ||
build-and-upload: | ||
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: 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. yep :) |
||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }} | ||
path: | | ||
packages/core/dist/ | ||
packages/style/dist/ | ||
if-no-files-found: ignore |
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