Skip to content

Commit

Permalink
build: do not commit browserslist-db updates, it is just noise
Browse files Browse the repository at this point in the history
The strategy I implemented in #348 to always update the browserslist-db
on install *and commit the results* creates a lot of noise: a lot of
similar commits, and we still want to update this db in deploy anyway,
so it's not the right strategy.

This commit removes the code that commits the changes, and instead
updates the db in every workflow that tests or deploys Studio-Web.

Furthermore, Del is going to add a build-time dependency that will do
this update automatically when you build or serve locally, so we do the
same everywhere, automatically, and reasonably quietly.
  • Loading branch information
joanise committed Nov 22, 2024
1 parent 705d578 commit 08d1452
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
with:
node-version: "20"
- run: npm install
- run: npx update-browserslist-db@latest
- run: npx nx build web-component
- run: npx nx bundle web-component
- name: Create Pull Request
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install
run: |
npm install
- run: npm install
- run: npx update-browserslist-db@latest
- name: Build web-component
run: |
npx nx build web-component
# create the bundles required for studio-web
# TODO: stop updating the bundle, keep the published one.
npx nx bundle web-component
- name: Test
- name: Specs Test
run: |
npx nx test:once studio-web
- name: Build
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/dev-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install
run: |
npm install
- run: npm install
- run: npx update-browserslist-db@latest
- name: Build web-component
run: |
npx nx build web-component
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ jobs:
- name: Always test with the latest browserslist db
run: |
npx update-browserslist-db@latest
- name: Commit browserslist db changes on dev branches
if: ${{ github.ref_type == 'branch' && ! github.ref_protected }}
run: |
if git diff --exit-code package-lock.json; then
echo "The browserslist db is up to date."
else
echo "The browserslist db is out of date."
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add package-lock.json
git commit -m "chore: update browserslist db"
git push
fi
- name: Ng test for studio-web
run: |
npx nx build web-component
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
if: github.event.action != 'closed'
run: |
npm install
- name: Always test with the latest browserslist db
- name: Always preview with the latest browserslist db
if: github.event.action != 'closed'
run: |
npx update-browserslist-db@latest
- name: Build web-component
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
registry-url: "https://registry.npmjs.org"
scope: "@readalongs"
- run: npm install
- run: npx update-browserslist-db@latest
- name: Build and bundle
run: |
npx nx build web-component
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
node-version: 20
- run: npm install --verbose
- run: npx update-browserslist-db@latest
- name: Ng test for studio-web
run: |
npx nx build web-component
Expand Down

0 comments on commit 08d1452

Please sign in to comment.