Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 0f0fce5

Browse files
committed
Change configuration
1 parent c5fb5fb commit 0f0fce5

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
1-
name: Publish NPM Package
1+
name: Node.js Package
22

33
on:
4-
push:
5-
# branches:
6-
# - main
4+
release:
5+
# types: [created]
76

87
jobs:
9-
publish:
8+
build:
109
runs-on: ubuntu-latest
11-
1210
steps:
13-
- name: Checkout Repository
14-
uses: actions/checkout@v2
15-
16-
- name: Set up Node.js
17-
uses: actions/setup-node@v2
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v3
1813
with:
1914
node-version: 20.5.1
15+
- run: npm ci
16+
- run: npm test
2017

21-
- name: Install Dependencies
22-
run: npm install
23-
24-
# - name: Build Package
25-
# run: npm run build
26-
27-
- name: Print Environment Variables
28-
run: |
29-
printenv
30-
31-
- name: Publish to NPM
32-
run: |
33-
echo "NPM_TOKEN: ${{ secrets.NPM_TOKEN }}"
34-
npm whoami
35-
npm publish --access=public
18+
publish-gpr:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
permissions:
22+
packages: write
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 16
29+
registry-url: https://npm.pkg.github.com/
30+
- run: npm ci
31+
- run: npm publish
3632
env:
37-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@canopassoftware:registry=https://npm.pkg.github.com

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.1.28",
44
"description": "Show the preview of file and manage files data to upload",
55
"main": "/src/app/index.ts",
6+
"publishConfig": {
7+
"@canopassoftware:registry": "https://npm.pkg.github.com"
8+
},
69
"repository": {
710
"type": "git",
811
"url": "git+https://github.com/canopas/react-file-upload.git"

0 commit comments

Comments
 (0)