Skip to content

Commit fc853a5

Browse files
authored
feat: update npm publishing (#39)
* feat: update npm publishing * chore: add homepage * chore: update action * fix: npm install
1 parent 2f0f1fc commit fc853a5

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed

.github/actions/setup/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ runs:
77
- name: Setup Node.js
88
uses: actions/setup-node@v4
99
with:
10-
node-version: 20.x
10+
node-version: '20.x'
1111
node-version-file: .nvmrc
1212

13+
- name: Upgrade npm for trusted publishing
14+
run: npm install -g npm@latest
15+
shell: bash
16+
1317
- name: Install dependencies
1418
run: |
1519
npm ci

.github/workflows/publish-release.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@ on:
33
pull_request:
44
types: [closed]
55
branches:
6-
- 'main'
6+
- "main"
77
push:
88
tags:
9-
- 'v*'
9+
- "v*"
10+
11+
permissions:
12+
contents: write
13+
id-token: write
1014

1115
jobs:
1216
release_gh:
13-
name: Create new GitHub release
17+
name: Create new GitHub release
1418
if: contains(github.event.pull_request.labels.*.name, 'release')
1519

1620
runs-on: ubuntu-latest
1721
steps:
1822
- uses: actions/checkout@v4
1923

20-
- name: Setup Node
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: '20.x'
24-
registry-url: 'https://registry.npmjs.org'
24+
- name: Setup
25+
uses: ./.github/actions/setup
2526

2627
- name: git config
2728
run: |
@@ -48,28 +49,17 @@ jobs:
4849
steps:
4950
- uses: actions/checkout@v4
5051

51-
- name: Setup Node
52-
uses: actions/setup-node@v4
53-
with:
54-
node-version: '20.x'
55-
registry-url: 'https://registry.npmjs.org'
56-
node-version-file: .nvmrc
57-
58-
- name: Install dependencies
59-
run: npm ci
60-
shell: bash
52+
- name: Setup
53+
uses: ./.github/actions/setup
6154

6255
- name: Compile .ts files
6356
run: npm run ts:build
6457
shell: bash
6558

66-
6759
- name: Configure git
6860
run: |
6961
git config user.name "${GITHUB_ACTOR}"
7062
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
71-
72-
- name: Publish package
63+
64+
- name: Publish package
7365
run: npm publish
74-
env:
75-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"bugs": {
1616
"url": "https://github.com/talsec/Free-RASP-Capacitor/issues"
1717
},
18+
"homepage": "https://docs.talsec.app/freerasp",
1819
"keywords": [
1920
"capacitor",
2021
"plugin",

0 commit comments

Comments
 (0)