Skip to content

Commit

Permalink
add extract-api.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRod1999 committed Oct 14, 2024
1 parent c15e1f3 commit 2aadbd0
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/extract-api.yaml
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

0 comments on commit 2aadbd0

Please sign in to comment.