Skip to content

chore: update peerDependencies and add .npmignore for codecov files (… #8

chore: update peerDependencies and add .npmignore for codecov files (…

chore: update peerDependencies and add .npmignore for codecov files (… #8

Workflow file for this run

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"