Skip to content

Commit

Permalink
chore(actions): pass NPM_TOKEN secret into workflow_call
Browse files Browse the repository at this point in the history
  • Loading branch information
venikx committed Jun 5, 2023
1 parent 114bdbf commit f9cdb56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
needs: build_and_test
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/release.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy_docs:
needs: build_and_test
Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Release/Publish
on: workflow_call
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
Expand All @@ -16,19 +20,8 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci --prefer-offline

- run: |
set -ex
git config color.status always
env
hostname
whoami
node --version
npm --version
cat ~/.npmrc || true
- name: Create a Release Pull Request or Publish to Registry
id: changesets
uses: changesets/action@v1
Expand All @@ -38,17 +31,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: |
set -ex
git config color.status always
env
hostname
whoami
node --version
npm --version
cat ~/.npmrc || true

- name: Publish Released Documentation
if: steps.changesets.outputs.published == 'true'
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
"require": "./dist/index.cjs",
"browser": "./dist/index.umd.js"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"files": [
"dist/*",
"src/*",
Expand Down

0 comments on commit f9cdb56

Please sign in to comment.