Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# @format

name: release-if-necessary

on:
Expand All @@ -12,18 +14,18 @@ jobs:
strategy:
matrix:
package:
- "@requestnetwork/add-stakeholder"
- "@requestnetwork/create-invoice-form"
- "@requestnetwork/invoice-dashboard"
- '@requestnetwork/add-stakeholder'
- '@requestnetwork/create-invoice-form'
- '@requestnetwork/invoice-dashboard'
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies 📥
run: npm ci
Expand All @@ -39,14 +41,9 @@ jobs:
echo "is-release-needed=$IS_RELEASE_NEEDED"
echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUT

- name: Setup .npmrc file to publish to npm 📝
if: steps.is-release-needed.outputs.is-release-needed == 'true'
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.REQUEST_BOT_NPM_TOKEN }}" > ~/.npmrc

- name: Publish package on NPM 📦
if: steps.is-release-needed.outputs.is-release-needed == 'true'
run: |
npm config set registry https://registry.npmjs.org
npm whoami || { echo "Failed to identify npm user."; exit 1; }
npm config get registry || { echo "Failed to get npm registry."; exit 1; }
npm publish --workspace=${{ matrix.package }} --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.REQUEST_BOT_NPM_TOKEN }}