-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c15e1f3
commit 2aadbd0
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# imodel-transformer Extract API Build | ||
|
||
name: Extract API | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
- release/* | ||
paths-ignore: | ||
- "**.md" | ||
- docs/** | ||
- .github/CODEOWNERS | ||
- common/changes/**/*.json | ||
- "**/CHANGELOG.json" | ||
- "**/CHANGELOG.md" | ||
|
||
jobs: | ||
extract-api: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure git | ||
run: | | ||
git config --local user.email imodeljs-admin@users.noreply.github.com | ||
git config --local user.name imodeljs-admin | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Pnpm install | ||
run: pnpm install | ||
|
||
- name: Pnpm build | ||
run: pnpm run build | ||
|
||
- name: Install API Extractor | ||
run: pnpm add --save-dev @microsoft/api-extractor | ||
|
||
- name: Run API Extractor | ||
run: npx api-extractor run | ||
|
||
- name: Assert no uncommitted changes (for extension api) | ||
shell: bash | ||
run: | | ||
if [ $(git status --porcelain | wc -l) -ne "0" ]; then | ||
echo "The following file(s) contain uncommitted changes:" | ||
git status --porcelain -u | ||
echo -e 'Please do the following:\n1. run `rush extract-api` in the monorepo \n2. commit the modified generated extension api files (found in the core/frontend and core/extension dirs) \n3. run rush change and commit the change files for core-frontend and core-extension' | ||
exit 1 | ||
fi | ||
- name: Publish extracted api | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: extracted-api | ||
path: common/api |