-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (36 loc) · 1.3 KB
/
check-dist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Check dist/ directories
on: [pull_request, workflow_dispatch]
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version: '12.18.1'
cache: 'yarn'
- name: Fetch Node Packages
run: |
yarn --immutable
- name: Rebuild dist/ directories
run: |
yarn build
- name: Compare the expected and actual dist/ directories
id: diff
run: |
for package in rename_binaries get_release_details set_ssh_key extract_info close_pull_request_issues fetch_release_changelogs
do
if [ "$(git diff --ignore-space-at-eol '${package}/dist/:!**/node_modules/**' | wc -l)" -gt "0" ]; then
echo "::set-output name=package::${package}"
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
done
# If dist/ is different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: format('{0}/dist/', steps.diff.outputs.package) }}