Skip to content

Commit

Permalink
Add gh workflow for publishing to npm when release created
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfisher committed May 26, 2022
1 parent 350b16f commit d40a7f1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 20 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release the Authsignal browser package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
- run: yarn
- run: yarn build

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
registry-url: "https://registry.npmjs.org"
- run: yarn
- run: yarn build
- run: yarn publish --access public
env:
YARN_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"@authsignal:registry" "https://registry.npmjs.org"
"registry" "https://registry.npmjs.org"
2 changes: 2 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"@authsignal:registry" "https://registry.npmjs.org"
"registry" "https://registry.npmjs.org"
37 changes: 17 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
{
"name": "authsignal-browser",
"name": "@authsignal/browser",
"type": "module",
"version": "0.0.1",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"keywords": ["authsignal", "mfa", "2fa", "authentication"],
"license": "MIT",
"repository": "git:https://github.com/authsignal/authsignal-browser.git",
"sideEffects": false,
"scripts": {
"typecheck": "tsc",
"clean": "rm -rf ./dist",
"lint": "eslint \"{cli,config,src,test}/**/*.ts\"",
"build": "rollup --configPlugin rollup-plugin-ts --config rollup.config.ts"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/authsignal/authsignal-browser.git"
},
"sideEffects": false,
"type": "module",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/index.d.ts"
}
},
"dependencies": {
"@fingerprintjs/fingerprintjs": "^3.3.3",
"a11y-dialog": "^7.4.0",
Expand All @@ -46,5 +35,13 @@
"rollup-plugin-ts": "^2.0.7",
"tslib": "^2.4.0",
"typescript": "^4.6.4"
},
"files": ["dist"],
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/index.d.ts"
}
}
}

0 comments on commit d40a7f1

Please sign in to comment.