feat: support AcDb2LineAngularDimension and upgrade lirbrdwg-web to v… #21
This file contains hidden or 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
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [master] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| environment: release | |
| defaults: | |
| run: | |
| working-directory: ./bindings/javascript | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: 'pnpm' | |
| cache-dependency-path: bindings/javascript/pnpm-lock.yaml | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@mlightcad' | |
| - name: Upgrade npm for Trusted Publishing | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Build the package | |
| run: pnpm build | |
| - name: Unit tests | |
| run: pnpm test | |
| # Authenticates via npm Trusted Publishing (OIDC); no NPM_TOKEN needed. | |
| # Configure the package on npmjs.com → Settings → Trusted publishing: | |
| # Provider: GitHub Actions | |
| # Repository: mlightcad/libredwg-web | |
| # Workflow filename: ci-cd.yml | |
| # Environment: release (must match the job environment below) | |
| - name: Publish packages to npm | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| npm --version | |
| # setup-node writes an empty _authToken line that blocks OIDC fallback | |
| if [ -f "$HOME/.npmrc" ]; then | |
| sed -i '/_authToken/d' "$HOME/.npmrc" | |
| fi | |
| pnpm publish:npm | |
| - name: Create GitHub release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| generate_release_notes: true | |
| - name: Build API docs | |
| if: github.ref == 'refs/heads/master' | |
| run: pnpm doc | |
| - name: Prepare GitHub Pages content | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| mkdir -p examples/docs | |
| cp -r docs/* examples/docs/ | |
| - name: Upload artifact | |
| if: github.ref == 'refs/heads/master' | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: './bindings/javascript/examples/' | |
| deploy: | |
| needs: [ci] | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |