Skip to content

Commit 039f13b

Browse files
committed
chore: use trusted publishing
1 parent d30f9aa commit 039f13b

4 files changed

Lines changed: 22 additions & 10 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
name: Setup
22
description: Setup Node.js and install dependencies
33

4+
inputs:
5+
skip-cache:
6+
description: Skip dependency caching
7+
required: false
8+
default: "false"
9+
410
runs:
511
using: composite
612
steps:
713
- name: Setup Node.js
8-
uses: actions/setup-node@v4
14+
uses: actions/setup-node@v6
915
with:
1016
node-version-file: .node-version
17+
registry-url: "https://registry.npmjs.org"
1118

1219
- run: corepack enable
1320
shell: bash
1421

1522
- name: Restore dependencies
1623
id: yarn-cache
24+
if: inputs.skip-cache != 'true'
1725
uses: actions/cache/restore@v4
1826
with:
1927
path: |
@@ -25,7 +33,7 @@ runs:
2533
${{ runner.os }}-yarn-
2634
2735
- name: Install dependencies
28-
if: steps.yarn-cache.outputs.cache-hit != 'true'
36+
if: inputs.skip-cache == 'true' || steps.yarn-cache.outputs.cache-hit != 'true'
2937
run: yarn install --immutable
3038
shell: bash
3139

@@ -34,7 +42,7 @@ runs:
3442
shell: bash
3543

3644
- name: Cache dependencies
37-
if: steps.yarn-cache.outputs.cache-hit != 'true'
45+
if: inputs.skip-cache != 'true' && steps.yarn-cache.outputs.cache-hit != 'true'
3846
uses: actions/cache/save@v4
3947
with:
4048
path: |

.github/workflows/onRelease.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ on:
44
release:
55
types: [published]
66

7+
permissions:
8+
id-token: write
9+
contents: read
10+
711
jobs:
812
publish:
913
runs-on: ubuntu-latest
1014
steps:
1115
- name: Checkout
12-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1317

1418
- name: Setup
1519
uses: ./.github/actions/setup
20+
with:
21+
skip-cache: "true"
1622

1723
- name: Set npm tag
1824
id: set-npm-tag
@@ -24,7 +30,5 @@ jobs:
2430
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
2531
fi
2632
27-
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c
28-
with:
29-
token: "${{ secrets.NPM_TOKEN }}"
30-
tag: ${{ steps.set-npm-tag.outputs.NPM_TAG }}
33+
- name: Publish
34+
run: npm publish --tag ${{ steps.set-npm-tag.outputs.NPM_TAG }}

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"repository": {
5050
"type": "git",
51-
"url": "git+https://github.com/appzung/react-native-code-push.git"
51+
"url": "git+https://github.com/AppZung/react-native-code-push.git"
5252
},
5353
"dependencies": {
5454
"hoist-non-react-statics": "^3.3.2"

0 commit comments

Comments
 (0)