Skip to content

Commit

Permalink
Merge pull request #33 from lunarcloud/publishing
Browse files Browse the repository at this point in the history
add publishing
  • Loading branch information
lunarcloud authored Oct 15, 2023
2 parents 73dfbf2 + 3efaadd commit caf13c4
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 1,044 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI Build

on:
pull_request:
branches: [ "master" ]
release:
types: [ "published" ]
branches: [ "main" ]
workflow_dispatch:

jobs:
Expand Down
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@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build-prod

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
demo/
dist/
node_modules/
*conf*.j*
.*
package*.json
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1,043 changes: 7 additions & 1,036 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"name": "gameinput",
"version": "10.0.0",
"description": "",
"private": true,
"name": "@lunarcloud/gameinputjs",
"repository": {
"url": "https://github.com/lunarcloud/gameinputjs.git"
},
"publishConfig": {
"@lunarcloud:registry": "https://npm.pkg.github.com"
},
"version": "12.2.0",
"description": "Browser library to upgrade the Gamepad API experience",
"private": false,
"scripts": {
"lint": "npx eslint --ignore-path .gitignore --ext .js .",
"lint-fix": "npx eslint --ignore-path .gitignore --ext .js . --fix",
"docs": "shx rm -rf ./dist/docs && npx jsdoc -c jsdoc.conf.json",
"pre-build": "shx rm -rf dist && shx mkdir dist && shx cp -r demo dist/ && shx cp LICENSE dist/",
"pre-build": "shx rm -rf dist && shx mkdir dist && shx cp -r demo dist/ && shx cp -r img dist/demo && shx cp LICENSE dist/ && shx cp README.md dist/",
"build": "npm run pre-build && shx cp -r src/* dist/ ",
"serve": "npm run build && npx serve dist",
"build-prod": "npm run build && npm run docs"
Expand Down

0 comments on commit caf13c4

Please sign in to comment.