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 @epubknowledge/common package to Github Packages Registry | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Setup .npmrc file to publish to GitHub Packages | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://npm.pkg.github.com' | |
| always-auth: true | |
| # Defaults to the user or organization that owns the workflow file | |
| scope: '@epubknowledge' | |
| - run: yarn install --frozen-lockfile | |
| - name: Run Vitest and capture results | |
| continue-on-error: true | |
| run: yarn test --reporter=json --outputFile=.test-results.json | |
| - name: Require 85% test pass rate | |
| run: node .github/scripts/verify-test-pass-rate.mjs .test-results.json 85 | |
| - run: yarn publish |