Skip to content

Commit 437514c

Browse files
authored
Merge pull request #10 from gabrielbarth/sdx
chore: add github packages publish settings on workflow
2 parents 572a26f + 8723160 commit 437514c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Package to npmjs
1+
name: Publish Package to npmjs and GitHub Packages
22

33
on:
44
push:
@@ -35,3 +35,13 @@ jobs:
3535
run: npm publish
3636
env:
3737
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
38+
39+
- name: Configure npm authentication for GitHub Packages
40+
run: |
41+
echo "@OWNER:registry=https://npm.pkg.github.com" >> ~/.npmrc
42+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
43+
env:
44+
OWNER: ${{ github.repository_owner }}
45+
46+
- name: Publish to GitHub Packages
47+
run: npm publish --registry https://npm.pkg.github.com/

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@
3636
"repository": {
3737
"type": "git",
3838
"url": "git+https://github.com/gabrielbarth/analytics-event-factory.git"
39+
},
40+
"publishConfig": {
41+
"registry": "https://npm.pkg.github.com/"
3942
}
4043
}

0 commit comments

Comments
 (0)