Skip to content

add extract-api.yaml #10

add extract-api.yaml

add extract-api.yaml #10

Workflow file for this run

# imodel-transformer Extract API Build
name: Extract API
on:
workflow_dispatch:
pull_request:
branches:
- main
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 [email protected]
git config --local user.name imodeljs-admin
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Enable and install pnpm with corepack
run: corepack enable && corepack prepare pnpm@latest --activate
- 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 -w
# - name: Run API Extractor
# run: npx api-extractor run
- name: Run Extract API
run: pnpm run extract-api
working-directory: ${{ github.workspace }}/packages/transformer
- 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