Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish npm #1

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish GPR
name: Publish NPM

on:
release:
Expand Down Expand Up @@ -33,12 +33,12 @@ jobs:
name: dist
path: dist

publish-gpr:
publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -51,8 +51,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://npm.pkg.github.com
- name: Publish to GitHub Package Repository
run: npm publish
registry-url: https://registry.npmjs.org/
- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ on the academic paper [^1][^2]. Implementation ported from LitterBox[^3]. Node.j

## Installation

The package can be installed as `@se2p/pq-distance` from GitHub's npm registry using `npm` or similar. To this,
add the `--registry=https://npm.pkg.github.com` flag during installation:
The package can be installed as `@se2p/pq-distance` from npm:

```bash
npm install @se2p/pq-distance --registry=https://npm.pkg.github.com
```

To permanently use GitHub's npm registry for all packages of the `@se2p` scope, you may want to update your
project-level or global `.npmrc`. For example:

```bash
echo '@se2p:registry=https://npm.pkg.github.com' >> ~/.npmrc
npm install @se2p/pq-distance
```

## Usage
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@se2p/pq-distance",
"version": "1.0.0",
"version": "1.0.1",
"files": [
"dist"
],
Expand All @@ -9,9 +9,6 @@
"./dist/index.js"
],
"types": "dist/index.d.ts",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"repository": {
"type": "git",
"url": "git+https://github.com/se2p/pq-distance.git"
Expand Down