Skip to content

Commit

Permalink
chore(release): publish 3.5.0-theta.0 --tag=theta --access=public
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Jun 30, 2022
1 parent 26588e2 commit aecfe91
Show file tree
Hide file tree
Showing 77 changed files with 369 additions and 174 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# - name: restore lerna
# uses: actions/cache@v2
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
90 changes: 51 additions & 39 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
# When Release Pull Request is merged
push:
branches:
- '**'
- 'feat/**'
pull_request:
branches:
- next
Expand All @@ -18,7 +18,9 @@ jobs:
steps:
# Setup
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with :
ref : ${{ github.head_ref }}
- name: Setup Node ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
Expand All @@ -42,43 +44,40 @@ jobs:
- name: Get commit message
run: |
COMMIT_MESSAGE=$(git log --format=%s -n 1)
echo "commitmsg=${COMMIT_MESSAGE}" >> $GITHUB_ENV
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Show commit message
run : echo "$commitmsg"
run : echo "$COMMIT_MESSAGE"

# ------------------ If commit message not satisfied, skip -------------
- name: Commit message compliance verification
if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true
uses: andymckay/cancel-action@0.2

# Get & check npm publish dist-tag when event is push
- name: Get dist tag
if: startsWith( env.commitmsg , 'chore(release):' ) && github.event_name == 'push' && contains( env.commitmsg , '--tag=' )
run: |
TEMP=`echo $commitmsg | grep -oP "\-\-tag=(\w+)"`
DIST_TAG=`echo ${TEMP:6}`
echo "disttag=${DIST_TAG}" >> $GITHUB_ENV
- name: Show dist tag
if: startsWith( env.commitmsg , 'chore(release):' ) && github.event_name == 'push' && contains( env.commitmsg , '--tag=' )
run : echo "$disttag"
- name: Check dist tag
if: startsWith( env.commitmsg , 'chore(release):' ) && github.event_name == 'push' && !env.disttag
run: |
echo "Publish by pushing must provide parameter named tag, just like: chore(release): publish 1.0 --tag=beta"
- name: Cancelling
if: startsWith( env.commitmsg , 'chore(release):' ) && github.event_name == 'push' && !env.disttag
- name: Publish push tag verification
if: github.event_name == 'push' && contains( env.COMMIT_MESSAGE , '--tag=' ) != true
uses: andymckay/cancel-action@0.2

# ------------------ If event is push but there is no dist tag, exit -------------
# ------------------ If event is push -------------

# Get & check npm publish
- name: Get publish params
if: github.event_name == 'push'
run: |
PUBLISH_PARAMS=`echo $COMMIT_MESSAGE | grep -oE "^chore\(release\): publish \S*\s(.*)" | cut -d " " -f 4-`
echo "PUBLISH_PARAMS=${PUBLISH_PARAMS}" >> $GITHUB_ENV
- name: Show publish params
if: github.event_name == 'push'
run: echo "Publish pushing provide parameter [$PUBLISH_PARAMS]."

# Define ${CURRENT_VERSION}
- name: Set Current Version
if: startsWith( env.commitmsg , 'chore(release):' )
shell: bash -ex {0}
run: |
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
CURRENT_VERSION=$(node -p 'require("./package.json").version')
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
# Check git tag
- name: Tag Check
if: startsWith( env.commitmsg , 'chore(release):' )
id: tag_check
shell: bash -ex {0}
run: |
Expand All @@ -95,24 +94,37 @@ jobs:

# ------------------ If git tag already exists, skip -------------

- name: Git tag verification
if: steps.tag_check.outputs.exists_tag != 'false'
uses: andymckay/cancel-action@0.2

# Bootstrap project
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: install
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: yarn
uses: pnpm/action-setup@v2.1.0
with:
version: 7.4.0
run_install: |
- recursive: true
args: [--frozen-lockfile]
- name: build
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: yarn build
run: pnpm run build

# Git stash
- name: Drop current changes
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: |
git add .
git stash
# Create git tag
- name: Create Git Tag
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
uses: azu/action-package-version-to-git-tag@v1
with:
version: ${{ env.CURRENT_VERSION }}
Expand All @@ -121,27 +133,28 @@ jobs:
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"

# ------------------ Before publish -------------
# ------------------ publish -------------

# Publish
- name: Publish
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: |
if [ '${{ github.event_name }}' == 'pull_request' ] ; then
yarn lerna publish from-package --yes
pnpm -r --filter=./packages/* exec npm publish
elif [ '${{ github.event_name }}' == 'push' ] ; then
yarn lerna publish from-package --dist-tag ${{ env.disttag }} --yes
pnpm -r --filter=./packages/* exec npm publish ${{ env.PUBLISH_PARAMS }}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# ------------------ After publish -------------

# Create relase when event is PR
- name: Pull request merged verification
if: github.event.pull_request.merged != true
uses: andymckay/cancel-action@0.2

# Create release when event is PR
- name: Create Release
id: create_release
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -156,7 +169,6 @@ jobs:

# Create PR page comment when event is PR
- uses: actions/github-script@0.8.0
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taro",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "开放式跨端跨框架开发解决方案",
"homepage": "https://github.com/NervJS/taro#readme",
"author": "O2Team",
Expand Down Expand Up @@ -65,7 +65,6 @@
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-replace": "^2.2.0",
"@rollup/plugin-typescript": "^8.3.1",
"@tarojs/components": "workspace:*",
"@tarojs/helper": "workspace:*",
"@tarojs/mini-runner": "workspace:*",
Expand Down Expand Up @@ -173,6 +172,7 @@
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-node-externals": "^4.0.0",
"rollup-plugin-postcss": "^3.1.8",
"rollup-plugin-ts": "^3.0.2",
"shelljs": "^0.8.1",
"sinon": "^7.5.0",
"stylelint": "^14.6.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-react-jsx-to-rn-stylesheet",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "Transform stylesheet selector to style in JSX Elements.",
"license": "MIT",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-taroapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-taroapi",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"main": "dist/index.js",
"scripts": {
"build": "tsc"
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-taro",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "> TODO: description",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/babel-preset-taro#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/css-to-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taro-css-to-react-native",
"description": "Convert CSS text to a React Native stylesheet object",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"main": "dist/index.js",
"license": "MIT",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-taro",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "Taro specific linting rules for ESLint",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-html-transform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-html-transform",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "transform html tag name selector",
"main": "index.js",
"author": "drchan",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-plugin-constparse/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-plugin-constparse",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "parse constants defined in config",
"main": "index.js",
"author": "Simba",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-pxtransform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-pxtransform",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
"keywords": [
"postcss",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/shared",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "> TODO: description",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/shared#readme",
Expand Down
13 changes: 7 additions & 6 deletions packages/shared/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import typescript from '@rollup/plugin-typescript'
import ts from 'rollup-plugin-ts'

const { join } = require('path')

Expand All @@ -15,10 +15,11 @@ const baseConfig = {
}
],
plugins: [
typescript({
compilerOptions: {
ts({
tsconfig: config => ({
...config,
preserveConstEnums: true
}
})
})
]
}
Expand All @@ -29,7 +30,7 @@ const esmConfig = Object.assign({}, baseConfig, {
file: join(cwd, 'dist/shared.esm.js')
}),
plugins: [
typescript()
ts()
]
})

Expand All @@ -45,7 +46,7 @@ const templateConfig = {
}
],
plugins: [
typescript()
ts()
]
}

Expand Down
6 changes: 2 additions & 4 deletions packages/shared/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"extends": "../../tsconfig.root.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "lib",
"outDir": "dist",
"module": "ESNext",
"declaration": true,
"sourceMap": true
},
"include": [
"src"
]
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/stylelint-config-taro-rn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stylelint-config-taro-rn",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "Shareable stylelint config for React Native CSS modules",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-taro-rn/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stylelint-taro-rn",
"description": "A collection of React Native specific rules for stylelint",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"main": "dist/index.js",
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-alipay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/plugin-platform-alipay",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "支付宝小程序平台插件",
"author": "Chen-jj",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-alipay#readme",
Expand Down
4 changes: 2 additions & 2 deletions packages/taro-alipay/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import typescript from '@rollup/plugin-typescript'
import * as path from 'path'
import ts from 'rollup-plugin-ts'

const cwd = __dirname

const base = {
external: ['@tarojs/shared', '@tarojs/service'],
plugins: [typescript()]
plugins: [ts()]
}

// 供 CLI 编译时使用的 Taro 插件入口
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/api",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "Taro common API",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/api#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/cli",
"version": "3.5.0-beta.3",
"version": "3.5.0-theta.0",
"description": "cli tool for taro",
"main": "index.js",
"scripts": {
Expand Down
Loading

0 comments on commit aecfe91

Please sign in to comment.