From 30218579cc6666a703d56ad0d9b6f141da39b154 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Fri, 1 Jul 2022 22:39:21 +0800 Subject: [PATCH] ci: update publish workflow (#1358) * chore: set lerna changelogPreset * fix: version script * ci: update publish workflow --- .github/workflows/publish.yml | 5 ++++- commitlint.config.js | 2 +- lerna.json | 3 ++- package.json | 1 + packages/demo-app/package.json | 1 - 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c65759f8d..3c1c8ea9a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,9 +10,12 @@ on: description: Pre ID required: true default: alpha + append: + description: Additional options jobs: publish: + environment: release runs-on: ubuntu-latest steps: @@ -32,7 +35,7 @@ jobs: - name: Publish to GitHub # add `no-verify-access` due to https://github.com/lerna/lerna/issues/2788 run: | - pnpm -- lerna publish -m "release: %s" --conventional-commits --preid=${{ github.event.inputs.preid }} --no-verify-access --create-release=github --yes ${{ github.event.inputs.semver }} + pnpm lerna publish -m "release: %s" --conventional-commits --preid=${{ github.event.inputs.preid }} --no-verify-access --create-release=github --yes ${{ github.event.inputs.semver }} env: GH_TOKEN: ${{ secrets.BOT_PAT }} diff --git a/commitlint.config.js b/commitlint.config.js index 07a91268f..d75fad8aa 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -4,6 +4,6 @@ const { rules } = require('@commitlint/config-conventional'); module.exports = { extends: ['@commitlint/config-conventional'], rules: { - 'type-enum': [2, 'always', [...rules['type-enum'][2], 'api']], + 'type-enum': [2, 'always', [...rules['type-enum'][2], 'api', 'release']], }, }; diff --git a/lerna.json b/lerna.json index 256f8dc0e..17feafa4b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,6 @@ { "version": "0.1.0", "npmClient": "pnpm", - "useWorkspaces": true + "useWorkspaces": true, + "changelogPreset": "conventionalcommits" } diff --git a/package.json b/package.json index 1619ab736..d8ebf3aa0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "license": "MPL-2.0", "scripts": { "preinstall": "npx only-allow pnpm", + "version": "pnpm i --frozen-lockfile=false && git add pnpm-lock.yaml", "lerna": "lerna", "bootstrap": "lerna bootstrap", "prepare": "if test \"$NODE_ENV\" != \"production\" && test \"$CI\" != \"true\" ; then husky install ; fi", diff --git a/packages/demo-app/package.json b/packages/demo-app/package.json index c5856ba1d..60573e392 100644 --- a/packages/demo-app/package.json +++ b/packages/demo-app/package.json @@ -7,7 +7,6 @@ "private": true, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "version": "pnpm i --frozen-lockfile=false", "precommit": "lint-staged", "start": "parcel src/index.html", "dev": "cross-env PORT=5003 parcel src/index.html --public-url /demo-app --no-cache --hmr-port 6003",