chore: update peerDependencies and add .npmignore for codecov files (β¦ #8
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: π NPM Release Preview | |
| on: | |
| push: | |
| branches: | |
| - master # Only run this on master for now | |
| jobs: | |
| release: | |
| name: NPM release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Only read permissions for safety | |
| packages: write # Allow publishing to NPM | |
| steps: | |
| - name: π¦ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π§° Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.x | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: π₯ Install dependencies | |
| run: | | |
| npm ci | |
| npm install rxjs@6.2.0 | |
| - name: π§ͺ Run tests | |
| run: npm test | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5.0.7 | |
| with: | |
| files: ./coverage/lcov/coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| - name: π Get current version | |
| id: version_info | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| echo "Current package version is: $CURRENT_VERSION" | |
| echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | |
| - name: π¨ Bump version | |
| id: version_step | |
| run: | | |
| npm version patch --no-git-tag-version | |
| NEW_VERSION=$(node -p "require('./package.json').version") | |
| echo "Bumped to version: $NEW_VERSION" | |
| echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| - name: β Commit and tag version | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add package.json package-lock.json | |
| git commit -m "chore: release ${{ steps.version_step.outputs.version }}" | |
| git tag -a ${{ steps.version_step.outputs.version }} -m "Release ${{ steps.version_step.outputs.version }}" | |
| git push origin master --follow-tags | |
| - name: π Publish to NPM | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| CI: true | |
| # - name: πͺ΅ Simulate NPM publish | |
| # run: | | |
| # echo "Would publish version: ${{ steps.version_step.outputs.version }} to NPM" |