Skip to content

Commit 7a21788

Browse files
committed
ci: publish package to GitHub Packages and npmjs.org
1 parent d18f400 commit 7a21788

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- "*"
77

8+
permissions:
9+
contents: write
10+
packages: write
11+
812
jobs:
913
ci:
1014
name: CI - Build and Test
@@ -86,22 +90,34 @@ jobs:
8690
fi
8791
8892
- name: Create GitHub Release
89-
run: |
90-
if [[ "${{ steps.prerelease.outputs.is_prerelease }}" == "true" ]]; then
91-
gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --notes '${{ needs.changelog.outputs.release_body }}' --prerelease
92-
else
93-
gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --notes '${{ needs.changelog.outputs.release_body }}'
94-
fi
95-
env:
96-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
uses: softprops/action-gh-release@v1
94+
with:
95+
tag_name: ${{ github.ref_name }}
96+
name: ${{ github.ref_name }}
97+
body: ${{ needs.changelog.outputs.release_body }}
98+
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
99+
token: ${{ secrets.GITHUB_TOKEN }}
97100

98101
- name: Setup Node.js for NPM
99102
uses: actions/setup-node@v4
100103
with:
101104
node-version: "18"
102105
registry-url: "https://registry.npmjs.org"
103106

104-
- name: Publish to NPM
107+
- name: Set scope for GitHub
108+
run: |
109+
jq '.name = "@robert27/expo-github-cache"' package.json > tmp.json && mv tmp.json package.json
110+
111+
- name: Publish to GitHub Packages
112+
run: npm publish --registry=https://npm.pkg.github.com
113+
env:
114+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
116+
- name: Set scope for npmjs
117+
run: |
118+
jq '.name = "@eggl-js/expo-github-cache"' package.json > tmp.json && mv tmp.json package.json
119+
120+
- name: Publish to npmjs.org
105121
run: npm publish
106122
env:
107123
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"name": "@eggl-js/expo-github-cache",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"description": "A Expo build cache using GitHub as a storage backend.",
6+
"keywords": ["expo", "cache", "github", "build", "eas"],
57
"main": "build/index.js",
68
"types": "build/index.d.ts",
79
"repository": {
@@ -10,7 +12,8 @@
1012
},
1113
"files": ["/build"],
1214
"publishConfig": {
13-
"access": "public"
15+
"access": "public",
16+
"registry": "https://npm.pkg.github.com"
1417
},
1518
"scripts": {
1619
"lint": "biome check",

0 commit comments

Comments
 (0)