Skip to content

Commit

Permalink
github release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hotlong committed Mar 27, 2023
1 parent d24d789 commit b5239a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ jobs:
env:
CI: false
run: |
lerna version ${{ steps.branch-name.outputs.tag }} --git-tag-command "git tag -a v${{ steps.branch-name.outputs.tag }}-release -m lerna" --force-publish --exact --yes
git config user.name github-actions
git config user.email github-actions@github.com
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
lerna version ${{ steps.branch-name.outputs.tag }} --force-publish --exact --yes
- name: Yarn
run: yarn --frozen-lockfile
Expand All @@ -77,41 +80,23 @@ jobs:
- name: Lerna publish beta
if: ${{ steps.version.outputs.is_stable != 'true' }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
lerna publish --no-git-reset --yes --dist-tag beta
git add .
git commit -m "action: release ${{ steps.branch-name.outputs.tag }}"
git push
lerna publish --yes --dist-tag beta
env:
CI: false
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Lerna publish 1.0
if: ${{ startsWith(steps.branch-name.outputs.tag, '1.0') && steps.version.outputs.is_stable == 'true' }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
lerna publish --no-git-reset --yes --dist-tag 1.0
git add .
git commit -m "action: release ${{ steps.branch-name.outputs.tag }}"
git push
lerna publish --yes --dist-tag 1.0
env:
CI: false
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Lerna publish 1.1
if: ${{ startsWith(steps.branch-name.outputs.tag, '1.1') && steps.version.outputs.is_stable == 'true' }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
lerna publish --no-git-reset --yes
git add .
git commit -m "action: release ${{ steps.branch-name.outputs.tag }}"
git push
lerna publish --yes
env:
CI: false
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
],
"command": {
"version": {
"exact": true
"exact": true,
"gitTagCommand": "git tag %s-lerna -m %s"
},
"publish": {
"npmClient": "npm",
Expand Down

0 comments on commit b5239a0

Please sign in to comment.