From 5bafe36e3edd5ab29c2c50262e464086763e3b35 Mon Sep 17 00:00:00 2001 From: Braden McDorman Date: Thu, 27 Oct 2022 13:21:09 -0700 Subject: [PATCH] Use github package registry --- .github/workflows/cd.yml | 38 ++++++++++++++++++++++++++++++++++++++ .npmignore | 3 +++ .npmrc | 1 + package.json | 8 +++++--- 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/cd.yml create mode 100644 .npmignore create mode 100644 .npmrc diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..0a1eb28 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,38 @@ +name: Publish to GPR +on: + release: + types: ["created"] +jobs: + build: + runs-on: "ubuntu-latest" + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + node-version: [13.x] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: yarn install + - name: Build + run: yarn run build + publish-gpr: + runs-on: "ubuntu-latest" + needs: ["build"] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + registry-url: https://npm.pkg.github.com + scope: "@kipr" + - name: Publish to GPR + run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..b99e7de --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +node_modules +.git +.gitignore diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b7abe34 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@kipr:registry=https://npm.pkg.github.com \ No newline at end of file diff --git a/package.json b/package.json index a7b5678..4696c41 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,13 @@ "author": "KISS Institute for Practical Robotics", "license": "GPLv3", "private": false, + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, "scripts": { - "build": "tsc", - "install": "yarn run build" + "build": "tsc" }, - "peerDependencies": { + "devDependencies": { "typescript": "^4.8.4" } }