Skip to content

Commit 454404a

Browse files
ci: attempt bundle generation
Signed-off-by: venilinvasilev <[email protected]>
1 parent 796fe68 commit 454404a

File tree

1 file changed

+38
-12
lines changed

1 file changed

+38
-12
lines changed

.github/workflows/api-version-check.yml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,50 @@ jobs:
4646
- name: Install Dependencies
4747
run: pnpm install
4848

49-
- name: Build Base Commit
49+
- name: Install TypeScript and dts-bundle-generator
5050
run: |
51-
echo "Building base commit: ${{ github.event.pull_request.base.sha }}"
51+
pnpm add -D typescript
52+
pnpm add -g dts-bundle-generator ts-semver-detector
53+
54+
- name: Generate Base Commit Declarations
55+
run: |
56+
echo "Generating declarations for base commit: ${{ github.event.pull_request.base.sha }}"
5257
git checkout ${{ github.event.pull_request.base.sha }}
53-
task build
54-
cp lib/index.d.ts base.d.ts
55-
echo "Base build completed"
5658
57-
- name: Build Head Commit
59+
# Generate all declaration files using tsc
60+
npx tsc --declaration --emitDeclarationOnly --outDir temp/base-declarations
61+
62+
# Bundle all declarations into a single file
63+
dts-bundle-generator \
64+
-o base.d.ts \
65+
temp/base-declarations/src/index.d.ts \
66+
--project tsconfig.json \
67+
--no-banner || {
68+
echo "ERROR: Failed to bundle base declarations"
69+
exit 1
70+
}
71+
72+
echo "Base declarations generated"
73+
74+
- name: Generate Head Commit Declarations
5875
run: |
59-
echo "Building head commit: ${{ github.event.pull_request.head.sha }}"
76+
echo "Generating declarations for head commit: ${{ github.event.pull_request.head.sha }}"
6077
git checkout ${{ github.event.pull_request.head.sha }}
61-
task build
62-
cp lib/index.d.ts head.d.ts
63-
echo "Head build completed"
6478
65-
- name: Install ts-semver-detector
66-
run: pnpm add -g ts-semver-detector
79+
# Generate all declaration files using tsc
80+
npx tsc --declaration --emitDeclarationOnly --outDir temp/head-declarations
81+
82+
# Bundle all declarations into a single file
83+
dts-bundle-generator \
84+
-o head.d.ts \
85+
temp/head-declarations/src/index.d.ts \
86+
--project tsconfig.json \
87+
--no-banner || {
88+
echo "ERROR: Failed to bundle head declarations"
89+
exit 1
90+
}
91+
92+
echo "Head declarations generated"
6793
6894
- name: Check API Changes
6995
run: |

0 commit comments

Comments
 (0)