Skip to content

Commit

Permalink
ci: prevent outdated types from blocking release (#9011)
Browse files Browse the repository at this point in the history
**Related Issue:** #9008

## Summary

Commit changes to `components.d.ts` after building for release to
prevent lerna/npm publishing errors due to an unclean working tree. The
commit will be discarded once the workflow run's container is destroyed.

### Background

The `components.d.ts` file is tracked as a temporary workaround for
ionic-team/stencil#3239

To keep the types updated, `components.d.ts` is added to the index in a
pre-commit hook.


https://github.com/Esri/calcite-design-system/blob/2bb1ee24bb317c95e2bef8165c75583fe98ad714/.husky/pre-commit#L7-L13

However, the file can still be outdated if people make changes and don't
rebuild before creating another commit. This is mostly an issue with
small doc updates, like the PR linked above. If that happens, the
release will fail due to an unclean working tree.
  • Loading branch information
benelan authored Mar 30, 2024
1 parent 0c09301 commit d1c9d23
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/deploy-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
run: |
npm install
npm run build
# These git commands can be removed once we stop tracking components.d.ts
# For more info, see: https://github.com/Esri/calcite-design-system/pull/9011
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# the "|| true" prevents failure if there are no changes
git add packages/calcite-components/src/components.d.ts || true
git commit -m "build: update types" || true
npm run publish:latest
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit d1c9d23

Please sign in to comment.