From 6c7413203a5d011811a91a9ea5fc24d006634a20 Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Fri, 13 Oct 2023 14:44:30 -0400 Subject: [PATCH 1/3] Add support for publishing to private npm registry --- .github/workflows/build.yml | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9dcadf..ffc2c02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,13 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + registry-url: https://npm.pkg.github.com/ - run: yarn install - run: yarn build # - run: npm test env: CI: true + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + NPM_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package.json b/package.json index 022b41f..ada28fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "canvas-txt", - "version": "4.1.1", + "version": "4.2.0", "description": "Render multiline textboxes in HTML5 canvas with auto line breaks and better alignment system", "files": [ "dist" From d65176a5ea7b94d324bba35ea0ed10cb617d5caf Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Fri, 13 Oct 2023 15:04:49 -0400 Subject: [PATCH 2/3] Fixes namespace for new private npm package Co-authored-by: Ian-Howard-R20 --- .github/workflows/build.yml | 14 ++++++++++---- package.json | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffc2c02..cb83bfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,10 @@ -name: Node.js Build +name: Build and publish package -on: [push] +on: + push: + branches: + - master + - feature/gh-action-for-roll20-registry jobs: build: @@ -13,16 +17,18 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} registry-url: https://npm.pkg.github.com/ + # Defaults to the user or organization that owns the workflow file + scope: '@roll20' - run: yarn install - run: yarn build # - run: npm test env: CI: true - - run: yarn publish + - run: yarn npm publish env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} NPM_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package.json b/package.json index ada28fa..97712cd 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "canvas-txt", + "name": "@roll20/canvas-txt", "version": "4.2.0", "description": "Render multiline textboxes in HTML5 canvas with auto line breaks and better alignment system", "files": [ From 593155f561e5e3515fcdeb4ee6a6d3d2b571ec69 Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Fri, 13 Oct 2023 15:08:21 -0400 Subject: [PATCH 3/3] Turns out we're using Yarn 1 and not 2 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb83bfa..5cc3210 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: node-version: [17.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -28,7 +28,7 @@ jobs: # - run: npm test env: CI: true - - run: yarn npm publish + - run: yarn publish env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} NPM_TOKEN: ${{secrets.NPM_TOKEN}}