Skip to content

Commit

Permalink
ci: update release manual and lerna.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Didenko committed Apr 11, 2024
1 parent aea992c commit e993ae8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/release-manual.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Release and Publish Manual"

on:
workflow_dispatch:
push:
branches:
- main
on: workflow_dispatch

jobs:
build:
Expand All @@ -28,18 +24,19 @@ jobs:
- name: "Run build"
run: lerna run build

- name: "Version and publish" # Interesting step
- name: "Version and publish 🚀"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [ ${{ github.base_ref }} = development ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes
if [ ${{ github.base_ref }} = develop ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid alpha --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi
npx lerna publish from-git --yes
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npx lerna publish from-git --yes
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release and Publish"
name: "Release and Publish Manual"

on:
push:
Expand All @@ -7,7 +7,7 @@ on:

jobs:
build:
name: Build
name: "Build"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
Expand All @@ -27,17 +27,19 @@ jobs:
- name: "Run build"
run: lerna run build

- name: "Version and publish" # Interesting step
- name: "Version and publish 🚀"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [ ${{ github.base_ref }} = development ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes
if [ ${{ github.base_ref }} = develop ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid alpha --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npx lerna publish from-git --yes
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"createRelease": "github",
"conventionalCommits": true,
"allowBranch": [
"main"
"main",
"develop"
],
"message": "chore(release): publish"
}
Expand Down

0 comments on commit e993ae8

Please sign in to comment.