Skip to content

Commit 68f9b9d

Browse files
authored
Publish to npm (#3)
Add publishing to an npm registry
1 parent df5f0ac commit 68f9b9d

File tree

12 files changed

+163
-135
lines changed

12 files changed

+163
-135
lines changed

.github/workflows/publish-npm.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish to npm
2+
on:
3+
push:
4+
tags:
5+
- v[0-9].[0-9]+.[0-9]+
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
- run: yarn
14+
- run: yarn workspace @jsdrupal/client build
15+
- run: yarn ci
16+
- run: |
17+
echo "npmAuthToken: \"${{ secrets.GITHUB_TOKEN }}\"" >> .yarnrc.yml
18+
- run: yarn workspace @jsdrupal/client npm publish --access=public

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
!.yarn/plugins
66
!.yarn/sdks
77
!.yarn/versions
8+
.npmrc

.pnp.js

Lines changed: 94 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/install-state.gz

-3.55 KB
Binary file not shown.

.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ plugins:
33
spec: "@yarnpkg/plugin-workspace-tools"
44

55
yarnPath: .yarn/releases/yarn-berry.cjs
6+
npmPublishRegistry: "https://npm.pkg.github.com"
7+
npmPublishAccess: "public"

client/.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src
2+
rollup.config.js

client/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"name": "@drupal/client",
2+
"name": "@jsdrupal/client",
3+
"version": "0.0.1",
34
"main": "index.js",
5+
"repository": "git://github.com/jsdrupal/js-client.git",
46
"scripts": {
57
"build": "rimraf dist && rollup -c && mv dist/index.js index.js && rimraf dist",
68
"eslint": "yarn g:eslint",

example-node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const request = require('@drupal/client').request;
1+
const request = require('@jsdrupal/client').request;
22

33
module.exports = async () => {
44
const resp = await request({

example-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"eslintci": "yarn g:eslint -o ../reports/eslint/example-node.json -f json"
1111
},
1212
"dependencies": {
13-
"@drupal/client": "workspace:client",
13+
"@jsdrupal/client": "workspace:client",
1414
"eslint": "^7.14.0",
1515
"eslint-config-prettier": "^6.15.0",
1616
"eslint-plugin-prettier": "^3.2.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@drupal/js-client",
2+
"name": "@jsdrupal/js-client",
33
"private": true,
44
"workspaces": [
55
"docs",

0 commit comments

Comments
 (0)