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
15 changes: 14 additions & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: yarn install --frozen-lockfile
- run: yarn build:prod
- run: yarn publish --non-interactive --access public
# A release that already published is re-runnable: the version is skipped, not an error.
- name: Publish to npm
run: |
PKG="$(node -p "const p = require('./package.json'); p.name + '@' + p.version")"
if npm view "$PKG" version > /dev/null 2>&1; then
echo "$PKG is already on npm, skipping."
exit 0
fi
yarn publish --non-interactive --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# Mirror to GitHub Packages so frontapp/front can install @frontapp/ui-kit
Expand All @@ -47,6 +55,11 @@ jobs:
printf '%s\n' \
'registry=https://npm.pkg.github.com' \
"//npm.pkg.github.com/:_authToken=$GITHUB_PACKAGES_TOKEN" > "$NPM_CONFIG_USERCONFIG"
PKG="$(node -p "const p = require('./package.json'); p.name + '@' + p.version")"
if npm view "$PKG" version > /dev/null 2>&1; then
echo "$PKG is already on GitHub Packages, skipping."
exit 0
fi
yarn publish --non-interactive --access public
env:
GITHUB_PACKAGES_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
Loading