generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (51 loc) · 1.51 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Check dist/
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Rebuild the dist/ directories
run: |
pnpm run -r build
pnpm run -r package
- name: Compare the expected and actual dist/ directories
run: |
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 versions as artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: |
actions/deploy/dist
actions/pull-request-diff/dist