Remove jsdom override (#71) #24
Workflow file for this run
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: Publish Package to NPM | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Run workflow on version tags, e.g. v1.0.0 | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| environment: integration-tests | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # Fetch all history for proper versioning | |
| - name: Use Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.x' | |
| registry-url: 'https://registry.npmjs.org/' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set version from tag | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| - name: Build package | |
| run: npm run build | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| - name: Install Playwright browsers | |
| run: npx playwright install chromium | |
| - name: Update test data submodule | |
| run: npm run test:html2md:update | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| - name: Generate release notes | |
| id: release | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| # Extract changes from git log if available | |
| CHANGES=$(git log --pretty=format:"* %s (%h)" $(git describe --tags --abbrev=0 HEAD^)..HEAD || echo "Initial release") | |
| echo "CHANGES<<EOF" >> $GITHUB_ENV | |
| echo "$CHANGES" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Release ${{ steps.release.outputs.version }} | |
| body: | | |
| ## Changes in this release | |
| ${{ env.CHANGES }} | |
| draft: false | |
| prerelease: false | |
| - name: Publish to NPM | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |