Skip to content

Commit 3bf0e31

Browse files
committed
setting .npmrc before publish
1 parent c30d5b0 commit 3bf0e31

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ jobs:
4141
echo 'RefName: ${{ github.ref_name }}'
4242
echo 'RefType: ${{ github.ref_type }}'
4343
44+
- name: Check if `Release`
45+
id: check_release
46+
if: >-
47+
github.event_name == 'release' &&
48+
matrix.node == '12.x' &&
49+
matrix.os == 'ubuntu-latest'
50+
run: |
51+
echo "::set-output name=release::true"
52+
4453
- name: Checkout repo
4554
uses: actions/checkout@v2
4655

@@ -73,11 +82,18 @@ jobs:
7382
run: yarn build
7483
working-directory: example
7584

85+
# Setup .npmrc file to publish to GitHub Packages
86+
- name: Setup Publish
87+
if: ${{ steps.check_release.outputs.release == 'true' }}
88+
uses: actions/setup-node@v3
89+
with:
90+
registry-url: 'https://npm.pkg.github.com'
91+
7692
- name: Publish
77-
if: >-
78-
github.event_name == 'release' &&
79-
matrix.node == '12.x' &&
80-
matrix.os == 'ubuntu-latest'
81-
# if: ${{ github.event_name == 'pull_request' && matrix.node == '12.x' && matrix.os == 'ubuntu-latest' }}
93+
if: ${{ steps.check_release.outputs.release == 'true' }}
94+
# run: yarn publish
8295
run: |
8396
echo 'Under Publish'
97+
cat .npmrc
98+
env:
99+
NODE_AUTH_TOKEN: ${{ env.GIT_PKG_PUBLISH_TOKEN }}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
".vscode",
88
".vscode-insiders"
99
],
10-
"cSpell.words": ["bahmutov"]
10+
"cSpell.words": ["bahmutov", "npmrc"]
1111
}

0 commit comments

Comments
 (0)