Skip to content

Commit

Permalink
Adapt to monorepo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
skorfmann committed Jun 28, 2023
1 parent a415bbe commit 1a109f8
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/

on:
Expand Down Expand Up @@ -31,23 +26,29 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Rebuild the dist/ directory
- name: Rebuild the dist/ directories
run: |
pnpm run -r build
pnpm run -r package
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
directories=("actions/deploy/dist" "actions/pull-request-diff/dist") # Add or remove directories as necessary
for dir in "${directories[@]}"; do
if [ "$(git diff --ignore-space-at-eol $dir | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes in $dir after build. See status below:"
git diff $dir
exit 1
fi
done
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
# If index.js was different than expected, upload the expected versions as artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
path: |
actions/deploy/dist
actions/pull-request-diff/dist

0 comments on commit 1a109f8

Please sign in to comment.