From e993ae8849d0967d6067ed8f89fe6aa3a93c2339 Mon Sep 17 00:00:00 2001 From: Egor Didenko Date: Wed, 10 Apr 2024 22:01:54 -0400 Subject: [PATCH] ci: update release manual and lerna.json --- .github/workflows/release-manual.yml | 17 +++++++---------- .github/workflows/release.yml | 12 +++++++----- lerna.json | 3 ++- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index 3e2b708..2aff860 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -1,10 +1,6 @@ name: "Release and Publish Manual" -on: - workflow_dispatch: - push: - branches: - - main +on: workflow_dispatch jobs: build: @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4987d86..203ec02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: "Release and Publish" +name: "Release and Publish Manual" on: push: @@ -7,7 +7,7 @@ on: jobs: build: - name: Build + name: "Build" runs-on: ubuntu-latest steps: - name: "Checkout" @@ -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 \ No newline at end of file diff --git a/lerna.json b/lerna.json index 3f2344c..bc583f6 100644 --- a/lerna.json +++ b/lerna.json @@ -6,7 +6,8 @@ "createRelease": "github", "conventionalCommits": true, "allowBranch": [ - "main" + "main", + "develop" ], "message": "chore(release): publish" }