Skip to content

Commit

Permalink
ci: removal of npm
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftwork committed Jun 3, 2024
1 parent 370ce13 commit a8aed47
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 29 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,20 @@ jobs:
with:
node-version: 20.x

- name: Append npm registry authentication to .npmrc
run: |
echo -e '\n//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}\n' >> ${NPM_CONFIG_USERCONFIG}
- name: Install dependencies using CI
run: npm ci
- name: Install dependencies
run: yarn --immutable

- name: Run tests on package
run: npm test
run: yarn test

- name: Update coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish package to GitHub Packages and GitHub Release
run: npm run release
run: yarn release
env:
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used to verify access through semantic release
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used by standard npm publish
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} # Used to verify access through semantic release
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} # Used by standard npm publish
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used for github releases through semantic release

- name: Publish package to NPM
run: npm publish --access public --@trutoo:registry=https://registry.npmjs.org
if: env.VERSION != null # Only if semantic-release publishes the package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Used by standard npm publish
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
node-version: ${{ matrix.node }}

- name: Install dependencies using CI
run: npm ci
run: yarn --immutable

- name: Run tests on package
run: npm test
run: yarn test

- name: Update coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build package
run: npm run build
run: yarn build
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ This project was created to improve upon some of the deficits CustomEvents has i

## Installation

Install from the [npm registry @trutoo/event-bus](https://www.npmjs.com/package/@trutoo/event-bus)
Install the package from the [npm registry @trutoo/event-bus](https://www.npmjs.com/package/@trutoo/event-bus) as a production/runtime dependency.

```bash
npm install @trutoo/event-bus
```

or

```bash
yarn add @trutoo/event-bus
```

_**Note: dropped publishing to GitHub packages to simplify releases.**_

Then either import the side effects only exposing a `eventBus` global instance.

```javascript
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
],
"husky": {
"hooks": {
"pre-push": "npm run test",
"pre-push": "yarn test",
"commit-msg": "node tools/commit-msg.js"
}
},
"scripts": {
"prebuild": "rimraf dist/*",
"build": "rollup -c",
"test": "jest",
"postversion": "npm run build",
"postversion": "yarn build",
"release": "semantic-release"
},
"dependencies": {
Expand All @@ -52,7 +52,6 @@
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/exec": "6.0.3",
"@semantic-release/github": "10.0.5",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
Expand Down
6 changes: 0 additions & 6 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,5 @@ export default {
assets: [{ path: 'dist/*.tgz', label: 'Distribution package' }],
},
],
[
'@semantic-release/exec',
{
successCmd: 'echo "VERSION=${nextRelease.version}" >> $GITHUB_ENV',
},
],
],
};

0 comments on commit a8aed47

Please sign in to comment.