diff --git a/.github/workflows/publish-cli.yaml b/.github/workflows/publish-cli.yaml deleted file mode 100644 index 5e2182109..000000000 --- a/.github/workflows/publish-cli.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Publish CLI - -on: - push: - branches: - - main - - release - paths: - - 'packages/cli/**' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - persist-credentials: false - ref: ${{ github.event.inputs.commit }} - - uses: actions/setup-node@v3 - with: - cache: yarn - node-version: 16 - - name: Install - run: yarn install - - name: Build - run: yarn build_all - working-directory: packages/sdk-all - - name: Clean templates node mdules - run: "rm -rf */node_modules" - working-directory: packages/cli/templates - - name: Semantic Release - id: semantic - uses: cycjimmy/semantic-release-action@v3 - with: - working_directory: packages/cli - env: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: mark prerelease and summary - if: steps.semantic.outputs.new_release_published == 'true' - run: | - echo "### New version v${{ steps.semantic.outputs.new_release_version }} cut" >> $GITHUB_STEP_SUMMARY - echo "commit: ${GITHUB_SHA}, branch/tag: ${GITHUB_REF}" >> $GITHUB_STEP_SUMMARY - echo "automatic release will be marked as prerelease, please manually confirm in the release page" >> $GITHUB_STEP_SUMMARY - echo "${{ steps.semantic.outputs.new_release_notes }}" >> $GITHUB_STEP_SUMMARY - env: - GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} - - name: report error - if: steps.semantic.outputs.new_release_published == 'false' - run: | - echo "### No version cut" >> $GITHUB_STEP_SUMMARY - echo "Check Semantic Release output for details" - exit 1 - outputs: - release_version: ${{ steps.release.outputs.release_version }} diff --git a/.github/workflows/publish-sdk.yaml b/.github/workflows/publish-sdk.yaml index a2e62e075..5ecc7b68f 100644 --- a/.github/workflows/publish-sdk.yaml +++ b/.github/workflows/publish-sdk.yaml @@ -1,4 +1,4 @@ -name: Publish SDK +name: Publish SDK & CLI on: push: @@ -27,26 +27,21 @@ jobs: - name: Semantic Release id: semantic uses: cycjimmy/semantic-release-action@v3 -# with: -# working_directory: packages/sdk env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} -# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Make Release Summary + - name: SDK Release Summary if: steps.semantic.outputs.new_release_published == 'true' run: | - echo "### New version v${{ steps.semantic.outputs.new_release_version }} cut" >> $GITHUB_STEP_SUMMARY + echo "### New SDK version v${{ steps.semantic.outputs.new_release_version }} cut" >> $GITHUB_STEP_SUMMARY echo "commit: ${GITHUB_SHA}, branch/tag: ${GITHUB_REF}" >> $GITHUB_STEP_SUMMARY - echo "automatic release will be marked as prerelease, please manually confirm in the release page" >> $GITHUB_STEP_SUMMARY echo "${{ steps.semantic.outputs.new_release_notes }}" >> $GITHUB_STEP_SUMMARY env: GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} - name: report error if: steps.semantic.outputs.new_release_published == 'false' run: | - echo "### No version cut" >> $GITHUB_STEP_SUMMARY + echo "### No SDK version cut" >> $GITHUB_STEP_SUMMARY echo "Check Semantic Release output for details" - exit 1 - name: Lerna Publish run: | DIST_TAG=latest @@ -57,5 +52,27 @@ jobs: yarn lerna publish ${{ steps.semantic.outputs.new_release_version }} --no-private --yes --no-push --no-git-tag-version --dist-tag $DIST_TAG env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - outputs: - release_version: ${{ steps.release.outputs.release_version }} + - name: Clean templates node mdules + run: "rm -rf */node_modules" + working-directory: packages/cli/templates + - name: Semantic Release CLI + id: semantic_cli + uses: cycjimmy/semantic-release-action@v3 + with: + working_directory: packages/cli + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: CLI Release Summary + if: steps.semantic_cli.outputs.new_release_published == 'true' + run: | + echo "### New CLI version v${{ steps.semantic_cli.outputs.new_release_version }} cut" >> $GITHUB_STEP_SUMMARY + echo "commit: ${GITHUB_SHA}, branch/tag: ${GITHUB_REF}" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.semantic_cli.outputs.new_release_notes }}" >> $GITHUB_STEP_SUMMARY + env: + GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} + - name: report error + if: steps.semantic.outputs.new_release_published == 'false' + run: | + echo "### No CLI version cut" >> $GITHUB_STEP_SUMMARY + echo "Check Semantic Release output for details" diff --git a/packages/cli/release.config.js b/packages/cli/release.config.js index 0c0e4cafc..2c7343007 100644 --- a/packages/cli/release.config.js +++ b/packages/cli/release.config.js @@ -16,6 +16,7 @@ module.exports = { }, ], ["@semantic-release/npm", { + npmPublish: true, }], ['@semantic-release/release-notes-generator', { preset: 'conventionalcommits',