Skip to content

Commit

Permalink
Feat: CLI tool (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpolaszek authored Jan 20, 2025
1 parent 0935028 commit 306be08
Show file tree
Hide file tree
Showing 12 changed files with 763 additions and 7 deletions.
48 changes: 46 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,39 @@ jobs:
run: yarn install

- name: Get initial dist checksum
id: initial-checksum
id: initial-dist-checksum
run: |
if [ -d "dist" ]; then
echo "checksum=$(find dist -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
else
echo "checksum=none" >> $GITHUB_OUTPUT
fi
- name: Get initial bin checksum
id: initial-bin-checksum
run: |
if [ -d "bin" ]; then
echo "checksum=$(find bin -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
else
echo "checksum=none" >> $GITHUB_OUTPUT
fi
- name: Get initial preview checksum
id: initial-preview-checksum
run: |
if [ -d "preview" ]; then
echo "checksum=$(find preview -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
else
echo "checksum=none" >> $GITHUB_OUTPUT
fi
- name: Build
run: yarn build

- name: Verify dist checksum
run: |
NEW_CHECKSUM=$(find dist -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d' ' -f1)
INITIAL_CHECKSUM=${{ steps.initial-checksum.outputs.checksum }}
INITIAL_CHECKSUM=${{ steps.initial-dist-checksum.outputs.checksum }}
if [ "$INITIAL_CHECKSUM" != "none" ] && [ "$NEW_CHECKSUM" != "$INITIAL_CHECKSUM" ]; then
echo "Error: dist folder content changed after build"
Expand All @@ -98,3 +116,29 @@ jobs:
echo "Please run 'yarn build' locally and commit the changes."
exit 1
fi
- name: Verify bin checksum
run: |
NEW_CHECKSUM=$(find bin -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d' ' -f1)
INITIAL_CHECKSUM=${{ steps.initial-bin-checksum.outputs.checksum }}
if [ "$INITIAL_CHECKSUM" != "none" ] && [ "$NEW_CHECKSUM" != "$INITIAL_CHECKSUM" ]; then
echo "Error: bin folder content changed after build"
echo "Initial checksum: $INITIAL_CHECKSUM"
echo "New checksum: $NEW_CHECKSUM"
echo "Please run 'yarn build:cli' locally and commit the changes."
exit 1
fi
- name: Verify preview checksum
run: |
NEW_CHECKSUM=$(find preview -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d' ' -f1)
INITIAL_CHECKSUM=${{ steps.initial-preview-checksum.outputs.checksum }}
if [ "$INITIAL_CHECKSUM" != "none" ] && [ "$NEW_CHECKSUM" != "$INITIAL_CHECKSUM" ]; then
echo "Error: preview folder content changed after build"
echo "Initial checksum: $INITIAL_CHECKSUM"
echo "New checksum: $NEW_CHECKSUM"
echo "Please run 'yarn build:preview' locally and commit the changes."
exit 1
fi
Loading

0 comments on commit 306be08

Please sign in to comment.