Skip to content

Commit

Permalink
fix: Mirror script
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Jan 1, 2024
1 parent 9f00af2 commit 09b7c60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Mirror to nuqs
run: ./packages/next-usequerystate/scripts/mirror.sh
run: |
cat package.json | jq '.version'
./scripts/mirror.sh
working-directory: packages/next-usequerystate
continue-on-error: true
env:
Expand Down
7 changes: 7 additions & 0 deletions packages/next-usequerystate/scripts/mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ set -e
# Place ourselves in the package directory
cd "$(dirname "$0")/.."

# Abort if the version was not bumped by semantic release
version=$(cat package.json | jq -r '.version')
if [[ $version == "0.0.0-semantically-released" ]]; then
echo "Aborting publish to nuqs: the version was not bumped by semantic release"
exit 0
fi

# Login to the npm registry
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc

Expand Down

0 comments on commit 09b7c60

Please sign in to comment.