Skip to content

Commit 8f461c3

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

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 8 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,40 @@ jobs:
8690
fi
8791
8892
- name: Create GitHub Release
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 }}
100+
101+
- name: Setup Node.js for GitHub Packages
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: "18"
105+
registry-url: "https://npm.pkg.github.com"
106+
107+
- name: Set scope for GitHub Packages
89108
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
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
95113
env:
96-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97115

98-
- name: Setup Node.js for NPM
116+
- name: Setup Node.js for npmjs.org
99117
uses: actions/setup-node@v4
100118
with:
101119
node-version: "18"
102120
registry-url: "https://registry.npmjs.org"
103121

104-
- name: Publish to NPM
122+
- name: Set scope for npmjs.org
123+
run: |
124+
jq '.name = "@eggl-js/expo-github-cache"' package.json > tmp.json && mv tmp.json package.json
125+
126+
- name: Publish to npmjs.org
105127
run: npm publish
106128
env:
107129
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)