Skip to content

Commit

Permalink
fix(publishing): pass --yes to lerna publish from-git (#9478)
Browse files Browse the repository at this point in the history
Also re-organize the workflow steps
  • Loading branch information
christopherthielen committed Jul 20, 2021
1 parent 093ea8a commit d4a6a4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ jobs:
with:
node-version: 12.16.0

- name: git - configure commit user
- name: git - tag bumped packages
id: tag
run: |
git config user.name spinnakerbot
git config user.email spinnakerbot@spinnaker.io
scripts/gha_tag_bumped_packages.sh
- name: publish packages to npm
if: ${{ steps.tag.outputs.tagged == 'true' }}
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
scripts/gha_publish.sh
yarn --frozen-lockfile
npx lerna publish from-git --yes
env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
17 changes: 4 additions & 13 deletions scripts/gha_publish.sh → scripts/gha_tag_bumped_packages.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

PACKAGES_TO_PUBLISH="";

# Run this script from the 'deck/packages' directory
cd "$(dirname "$0")/../packages" || exit 255

Expand All @@ -10,7 +8,7 @@ if [ "x${GITHUB_ACTIONS}" != "xtrue" ] ; then
exit 2
fi

BUMPS=no
TAGGED=false

# Determine what packages were bumped in the pushed commit and tag them
for PACKAGEJSON in */package.json ; do
Expand All @@ -20,16 +18,9 @@ for PACKAGEJSON in */package.json ; do
TAG=$(jq -r '.name + "@" + .version' < $PACKAGEJSON)
git tag -a $TAG -m "Publish $TAG to NPM"
git push origin $TAG
BUMPS=yes
TAGGED=true
fi
done

if [ "${BUMPS}" == "no" ] ; then
echo "Nothing to publish."
exit 0
fi

echo "Deck package publisher ---> yarn"
yarn

npx lerna publish from-git
## Github Action Step output variable: tagged
echo ::set-output name=tagged::$TAGGED

0 comments on commit d4a6a4b

Please sign in to comment.