Skip to content

Commit

Permalink
workflow to publish package
Browse files Browse the repository at this point in the history
  • Loading branch information
djalmajr committed Feb 4, 2022
1 parent 9514248 commit 46ee829
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"main": "dist/index.js",
"module": "dist/index.m.js",
"types": "dist/index.d.ts",
"homepage": "https://gitlab.com:sdconecta/sdconecta-utils#README",
"homepage": "https://github.com/djalmajr/help-es#README",
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com:sdconecta/sdconecta-utils.git"
"url": "git+ssh://git@github.com:djalmajr/help-es.git"
},
"bugs": {
"url": "https://gitlab.com:sdconecta/sdconecta-utils/issues"
"url": "https://github.com/djalmajr/help-es/issues"
},
"files": [
"dist"
Expand All @@ -31,13 +31,17 @@
"require": "./dist/*/*.js"
}
},
"publishConfig": {
"@djalmajr:registry": "https://npm.pkg.github.com"
},
"scripts": {
"build": "node ./scripts/build.mjs minify=true && npm run build:types",
"build:dev": "node ./scripts/build.mjs watch=true",
"build:types": "tsc --emitDeclarationOnly && cp src/types.d.ts dist",
"prettier:check": "prettier --check src/**/*.{ts,tsx}",
"prettier:fix": "prettier --write src/**/*.{ts,tsx}",
"postversion": "git push && git push --tags && npm publish",
"test": "exit 0",
"version": "npm run build"
},
"devDependencies": {
Expand Down

0 comments on commit 46ee829

Please sign in to comment.