Skip to content

Commit

Permalink
chore(release): merge sdk and cli release action
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 committed Dec 31, 2022
1 parent 0a463b1 commit 45def79
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 68 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/publish-cli.yaml

This file was deleted.

39 changes: 28 additions & 11 deletions .github/workflows/publish-sdk.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish SDK
name: Publish SDK & CLI

on:
push:
Expand Down Expand Up @@ -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
Expand All @@ -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"
1 change: 1 addition & 0 deletions packages/cli/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
},
],
["@semantic-release/npm", {
npmPublish: true,
}],
['@semantic-release/release-notes-generator', {
preset: 'conventionalcommits',
Expand Down

0 comments on commit 45def79

Please sign in to comment.