Skip to content

Commit

Permalink
fix(release): try again to get npmrc correct (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle authored Aug 1, 2023
1 parent a42b252 commit 4bdda37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
release_npm:
runs-on: ubuntu-latest
needs: [build]

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -106,25 +107,25 @@ jobs:
- name: Create NPM Package
run: |
pwd
find .
cp "README.md" "npm-staging/README.md"
cp "release/npm/index.js" "npm-staging/index.js"
cp ".npmrc" "npm-staging/.npmrc"
bazel run --config="release" "//release/npm" -- "${PWD}/CONTRIBUTORS" > "npm-staging/package.json"
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Publish NPM Package
if: ${{ github.event.release.upload_url }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ./npm-staging
# The setup-node@v3 step created an .npmrc file, but we changed directories. Copy it first.
run: |
cat ~/.npmrc || echo "Didn't find .npmrc"
cp ${GITHUB_WORKSPACE}/.npmrc .
npm config list
echo -n "Publishing to NPM as "
grep "version" < "package.json"
find . && cat package.json && npm install && echo "Publishing to npm..." && npm publish
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

0 comments on commit 4bdda37

Please sign in to comment.