Skip to content

Commit 3f668bc

Browse files
committed
Merge branch 'master' into add-storybook-component-squashable
2 parents 0467bea + 100f17f commit 3f668bc

File tree

120 files changed

+500
-2177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+500
-2177
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Please go over the checklist and make sure all conditions are met.
2727

2828
#### Tests
2929

30-
- [ ] Tests are compliant with [TESTING_README.md](TESTING_README.md) instructions.
30+
- [ ] Tests are compliant with [TESTING_README.md](/packages/core/TESTING_README.md) instructions.
3131

3232
#### Accessibility
3333

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Check Changed Packages
2+
description: Check if there are any changed packages in the monorepo
3+
4+
inputs:
5+
exit_on_no_changes:
6+
description: Whether to exit with a non-zero code if there are no changes.
7+
required: false
8+
default: "false"
9+
outputs:
10+
has_changes:
11+
description: Whether there are any changes in the monorepo.
12+
value: ${{ steps.check-changed-packages.outputs.has_changes }}
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- id: determine-since-flag
18+
uses: ./.github/actions/determine-lerna-since-flag
19+
- id: check-changed-packages
20+
shell: bash
21+
env:
22+
SINCE_FLAG: ${{ steps.determine-since-flag.outputs.since_flag }}
23+
run: |
24+
changed_packages=$(yarn -s lerna ls $SINCE_FLAG --json --loglevel=error)
25+
26+
if [[ $changed_packages = "[]" ]]; then
27+
echo "has_changes=false" >> $GITHUB_OUTPUT
28+
echo "No packages to process as Lerna didn't detect any changes."
29+
if [[ "${{ inputs.exit_on_no_changes }}" == "true" ]]; then
30+
exit 1
31+
else
32+
echo "Continuing because exit_on_no_changes is not used."
33+
fi
34+
else
35+
echo "has_changes=true" >> $GITHUB_OUTPUT
36+
echo "Change detected:"
37+
echo "$changed_packages"
38+
fi
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Determine Lerna since flag
2+
description: Determine the --since flag value for Lerna commands based on the branch. Should be used for workflows/actions that can be used on both default branch and other branches.
3+
4+
outputs:
5+
since_flag:
6+
description: The --since flag value to use with Lerna commands.
7+
value: ${{ steps.get-since-flag.outputs.since_flag }}
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- id: get-since-flag
13+
shell: bash
14+
run: |
15+
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
16+
since_flag="--since"
17+
echo "Running on master branch, checking for all changes."
18+
else
19+
since_flag="--since=origin/master...HEAD"
20+
echo "Not running on master branch, checking for changes since origin/master."
21+
fi
22+
23+
echo "since_flag=$since_flag" >> $GITHUB_OUTPUT
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Download and Extract Build Artifacts
2+
description: Download build artifacts for all the packages and extract them to the correct location
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Download and Extract
8+
uses: actions/download-artifact@v4
9+
with:
10+
name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }}
11+
path: packages/
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Upload Artifacts
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
npm_token:
7+
required: true
8+
outputs:
9+
has_changes:
10+
description: Whether there are any changes in the monorepo.
11+
value: ${{ jobs.build-and-upload.outputs.has_changes }}
12+
13+
jobs:
14+
build-and-upload:
15+
name: Build and Upload
16+
runs-on: ubuntu-latest
17+
outputs:
18+
has_changes: ${{ steps.check-changed-packages.outputs.has_changes }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Run Setup
25+
uses: ./.github/actions/setup
26+
with:
27+
npm_token: ${{ secrets.npm_token }}
28+
- id: check-changed-packages
29+
uses: ./.github/actions/check-changed-packages
30+
- id: determine-since-flag
31+
if: ${{ steps.check-changed-packages.outputs.has_changes == 'true' }}
32+
uses: ./.github/actions/determine-lerna-since-flag
33+
- name: Build
34+
if: ${{ steps.check-changed-packages.outputs.has_changes == 'true' }}
35+
shell: bash
36+
env:
37+
SINCE_FLAG: ${{ steps.determine-since-flag.outputs.since_flag }}
38+
run: yarn lerna run build $SINCE_FLAG --include-dependencies
39+
- name: Upload
40+
if: ${{ steps.check-changed-packages.outputs.has_changes == 'true' }}
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }}
44+
path: |
45+
packages/core/dist/
46+
packages/style/dist/
47+
if-no-files-found: ignore

.github/workflows/chromatic.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1-
name: "Chromatic"
1+
name: Chromatic
22

33
on: push
44

55
jobs:
6-
chromatic-deployment:
6+
build:
7+
name: Build
8+
uses: ./.github/workflows/build-and-upload.yml
9+
secrets:
10+
npm_token: ${{ secrets.npm_token }}
11+
12+
publish-chromatic:
13+
name: Publish Chromatic
14+
needs: build
15+
if: ${{ needs.build.outputs.has_changes == 'true' }}
716
runs-on: ubuntu-latest
817
steps:
9-
- uses: actions/checkout@v1
10-
- name: Install dependencies
11-
run: yarn
12-
- name: Check if there are changed packages
13-
id: changed-packages
14-
continue-on-error: true
15-
run: |
16-
changed_packages=$(yarn -s lerna ls --since=origin/master --json --loglevel=error)
17-
[[ $changed_packages = "[]" ]] && echo "HAS_CHANGES=false" >> $GITHUB_ENV || echo "HAS_CHANGES=true" >> $GITHUB_ENV
18-
- name: Run Build
19-
if: ${{ env.HAS_CHANGES == 'true' }}
20-
shell: bash
21-
run: yarn lerna run build --since=origin/master --include-filtered-dependencies
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Run Setup
22+
uses: ./.github/actions/setup
23+
with:
24+
npm_token: ${{ secrets.npm_token }}
25+
- uses: ./.github/actions/download-builds
2226
- name: Publish to Chromatic
23-
uses: chromaui/action@v1
24-
if: ${{ env.HAS_CHANGES == 'true' }}
27+
uses: chromaui/action@v11
2528
with:
2629
token: ${{ secrets.GITHUB_TOKEN }}
27-
# 👇 Chromatic projectToken, if you are project maintainer refer to the manage page to obtain it.
2830
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
2931
workingDir: packages/core

.github/workflows/ci.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
build:
9+
name: Build
10+
uses: ./.github/workflows/build-and-upload.yml
11+
secrets:
12+
npm_token: ${{ secrets.npm_token }}
13+
14+
test:
15+
name: Test
16+
needs: build
17+
if: ${{ needs.build.outputs.has_changes == 'true' }}
18+
uses: ./.github/workflows/test.yml
19+
secrets:
20+
npm_token: ${{ secrets.npm_token }}

.github/workflows/prerelease.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ on:
66
- "master"
77

88
jobs:
9-
prerelease:
9+
build:
10+
name: Build
1011
if: "contains(github.event.head_commit.message, '[prerelease]')"
12+
uses: ./.github/workflows/build-and-upload.yml
13+
secrets:
14+
npm_token: ${{ secrets.npm_token }}
15+
16+
prerelease:
17+
name: Prerelease
18+
needs: build
19+
if: ${{ needs.build.outputs.has_changes == 'true' }}
1120
runs-on: ubuntu-latest
1221
steps:
1322
- uses: actions/checkout@v4
@@ -18,12 +27,7 @@ jobs:
1827
with:
1928
npm_token: ${{ secrets.npm_token }}
2029
- uses: ./.github/actions/git-creds
21-
- name: Check if there are changed packages
22-
run: |
23-
changed_packages=$(yarn -s lerna ls --since=origin/master --json --loglevel=error)
24-
[[ $changed_packages = "[]" ]] && echo "Skipping prerelease. Nothing to prerelease as Lerna didn't detect any changes." && exit 1 || echo "Changed detected. Continuing to prerelease" && echo "$changed_packages"
25-
- name: Build all affected packages
26-
run: yarn lerna run build --since=origin/master --include-dependencies
30+
- uses: ./.github/actions/download-builds
2731
- name: Generate new versions
2832
id: generate-versions
2933
run: |

.github/workflows/publish-storybook.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,13 @@ jobs:
2222
run: |
2323
yarn lerna run build --include-dependencies
2424
yarn lerna run --scope monday-ui-react-core build-storybook
25-
yarn lerna run --scope monday-ui-style build-storybook
2625
cd packages/core/static_storybook
2726
echo "style.monday.com" > ./CNAME
2827
env:
2928
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
30-
- name: Push style Storybook to Github Pages
31-
if: success()
32-
uses: JamesIves/github-pages-deploy-action@v4.5.0
33-
with:
34-
folder: packages/style/storybook-static
35-
branch: gh-pages
36-
target-folder: style
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3929
- name: Push core Storybook to Github Pages
4030
uses: JamesIves/github-pages-deploy-action@v4.5.0
4131
with:
42-
clean-exclude: style/*
4332
folder: packages/core/static_storybook
4433
branch: gh-pages
4534
env:

.github/workflows/release.yml

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,37 @@ name: Release new version
33
on: workflow_dispatch
44

55
jobs:
6-
prerequisites:
7-
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
include:
11-
- name: "Test"
12-
command: "test"
13-
- name: "Lint"
14-
command: "lint"
15-
- name: "Stylelint"
16-
command: "stylelint"
17-
env:
18-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
19-
name: ${{ matrix.name }}
20-
steps:
21-
- uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0
24-
- name: Run Setup
25-
uses: ./.github/actions/setup
26-
with:
27-
npm_token: ${{secrets.npm_token}}
28-
- name: Run ${{matrix.name}}
29-
shell: bash
30-
run: yarn lerna run ${{matrix.command}} --since
6+
build:
7+
name: Build
8+
uses: ./.github/workflows/build-and-upload.yml
9+
secrets:
10+
npm_token: ${{ secrets.npm_token }}
11+
12+
test:
13+
name: Test
14+
needs: build
15+
if: ${{ needs.build.outputs.has_changes == 'true' }}
16+
uses: ./.github/workflows/test.yml
17+
secrets:
18+
npm_token: ${{ secrets.npm_token }}
19+
3120
release:
32-
needs: prerequisites
21+
name: Release
22+
needs: [build, test]
23+
if: ${{ needs.build.outputs.has_changes == 'true' }}
3324
runs-on: ubuntu-latest
3425
env:
35-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
26+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
3627
steps:
3728
- uses: actions/checkout@v4
3829
with:
3930
fetch-depth: 0
4031
- name: Run Setup
4132
uses: ./.github/actions/setup
4233
with:
43-
npm_token: ${{secrets.npm_token}}
34+
npm_token: ${{ secrets.npm_token }}
4435
- uses: ./.github/actions/git-creds
45-
- name: Run Build
46-
shell: bash
47-
run: yarn lerna run build --since --include-dependencies
36+
- uses: ./.github/actions/download-builds
4837
- name: Generate new versions
4938
run: yarn lerna version --exact --conventional-commits -y
5039
- run: yarn config set registry https://registry.npmjs.org/

0 commit comments

Comments
 (0)