Skip to content

Commit 95f4cae

Browse files
Merge pull request #260 from gin0606/fix/issue-259
fix: add prepack script to generate lib/ before publishing
2 parents 5f1e156 + e8e7a50 commit 95f4cae

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/npm-publish-github-packages.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,20 @@ jobs:
2222
with:
2323
node-version: '20.x'
2424
registry-url: 'https://registry.npmjs.org'
25-
- run: npm i
26-
- run: npm pack
27-
- run: npm publish --provenance --access public
25+
cache: 'yarn'
26+
27+
# Use Yarn instead of npm
28+
- name: Enable corepack (Yarn)
29+
run: corepack enable
30+
31+
- name: Install dependencies
32+
run: yarn install --immutable
33+
34+
- name: Build package tarball with Yarn
35+
run: yarn pack --out package.tgz
36+
37+
# Still use npm to publish the already-generated tarball
38+
- name: Publish to npm
39+
run: npm publish package.tgz --provenance --access public
2840
env:
2941
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"lint": "eslint \"**/*.{js,ts,tsx}\"",
4242
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build example/ios/Pods lib example-expo/ios/build example-expo/android/build example-expo/android/app/build example-expo/ios/Pods",
4343
"prepare": "bob build",
44+
"prepack": "bob build",
4445
"release": "release-it --only-version"
4546
},
4647
"keywords": [

0 commit comments

Comments
 (0)