From e0d5017cd22ff45f3bf9c84b0b87a757cfdae322 Mon Sep 17 00:00:00 2001 From: Arnaud Foraison Date: Mon, 1 Mar 2021 17:34:56 +0100 Subject: [PATCH] ci(workflow): fix lerna yes prompt --- .github/workflows/publish-release.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5a3145610..727ed22dd 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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: @@ -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: | @@ -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 }}