Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflow): fix lerna yes prompt #881

Merged
merged 1 commit into from
Mar 1, 2021
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
24 changes: 14 additions & 10 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,30 @@ jobs:
- run: npm ci
- run: npm run check
- run: npm test -- --coverage
- run: npm run storybook:build
- name: Build storybook
if: ${{ steps.release_var.outputs.isPreRelease == false }}
run: npm run storybook:build
- name: Upload Storybook into workflow artifact
if: ${{ steps.release_var.outputs.isPreRelease == false }}
uses: actions/upload-artifact@v2
with:
name: storybook-v${{steps.release_var.outputs.releaseVersion}}
name: storybook
path: ${{env.STORYBOOK_BUILD}}
- name: Publish pre-release packages to npm
if: ${{ steps.release_var.outputs.isPreRelease }} == true
run: npx lerna publish from-git --dist-tag next
if: ${{ steps.release_var.outputs.isPreRelease == true }}
run: npx lerna publish from-git --dist-tag next --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish release packages to npm
if: ${{ steps.release_var.outputs.isPreRelease }} == false
run: npx lerna publish from-git
if: ${{ steps.release_var.outputs.isPreRelease == false }}
run: npx lerna publish from-git --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy-storybook:
runs-on: ubuntu-latest
needs: publish
if: ${{ needs.publish.outputs.isPreRelease }} == false
if: ${{ needs.publish.outputs.isPreRelease == false }}
env:
RELEASE_VERSION: ${{ needs.publish.outputs.releaseVersion }}
defaults:
Expand All @@ -78,10 +81,11 @@ jobs:
echo "::set-output name=prevVersion::$prevVersion"
- uses: actions/download-artifact@v2
with:
name: storybook-v${{env.RELEASE_VERSION}}
path: gh-pages/react-toolkit/latest
name: storybook
path: gh-pages/react-toolkit
- name: Add version json file into latest
run: |
mv $STORYBOOK_BUILD latest
echo {\"version\":\"$RELEASE_VERSION\"} >> ./latest/version.json
- name: Commit changes
run: |
Expand All @@ -94,7 +98,7 @@ jobs:
release-gh:
runs-on: ubuntu-latest
needs: [publish, deploy-storybook]
if: ${{ needs.publish.outputs.isPreRelease }} == false
if: ${{ needs.publish.outputs.isPreRelease == false }}
env:
PREVIOUS_VERSION: ${{ needs.deploy-storybook.outputs.previousVersion }}
RELEASE_VERSION: ${{ needs.publish.outputs.releaseVersion }}
Expand Down