mirror of
https://github.com/zhigang1992/connect.git
synced 2026-04-24 05:05:50 +08:00
ci: setup lerna version/publish CI workflow
This commit is contained in:
34
.github/workflows/codecheck.yml
vendored
34
.github/workflows/codecheck.yml
vendored
@@ -1,34 +0,0 @@
|
||||
name: Codecheck
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
codecheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Set Node Version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.16.1
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v1
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Monorepo Dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
- name: Lerna Bootstrap
|
||||
run: yarn lerna bootstrap
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
- name: Depcheck
|
||||
run: yarn lerna run depcheck --parallel
|
||||
- name: Typecheck
|
||||
run: yarn lerna run typecheck --parallel
|
||||
109
.github/workflows/main.yml
vendored
Normal file
109
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
name: UX
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test_keychain:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Set Node Version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.16.1
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install monorepo deps
|
||||
run: yarn
|
||||
- name: Install Keychain dependencies
|
||||
run: yarn
|
||||
working-directory: ./packages/keychain
|
||||
- name: Keychain tests
|
||||
run: yarn lerna run test --scope @blockstack/keychain
|
||||
|
||||
codecheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Set Node Version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.16.1
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v1
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Monorepo Dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
- name: Lerna Bootstrap
|
||||
run: yarn lerna bootstrap
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
- name: Depcheck
|
||||
run: yarn lerna run depcheck --parallel
|
||||
- name: Typecheck
|
||||
run: yarn lerna run typecheck --parallel
|
||||
|
||||
publish:
|
||||
needs: [test_keychain, codecheck]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Checkout master
|
||||
run: git checkout master
|
||||
- name: Set Node Version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.16.1
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install monorepo deps
|
||||
run: yarn
|
||||
- name: Git status
|
||||
run: git status
|
||||
- name: Install package deps
|
||||
run: yarn lerna exec --parallel "yarn"
|
||||
- name: Git status
|
||||
run: git status
|
||||
- name: Setup .npmrc
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
||||
- name: Setup git
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
- name: Lerna Version
|
||||
run: yarn lerna version --conventional-commits --no-push --yes
|
||||
- name: Publish
|
||||
run: yarn lerna publish from-git --conventional-commits --yes
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@fe38f0a
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
30
.github/workflows/test-keychain.yml
vendored
30
.github/workflows/test-keychain.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Test (Keychain)
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test_keychain:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Set Node Version
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.16.1
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install monorepo deps
|
||||
run: yarn
|
||||
- name: Install Keychain dependencies
|
||||
run: yarn
|
||||
working-directory: ./packages/keychain
|
||||
- name: Keychain tests
|
||||
run: yarn lerna run test --scope @blockstack/keychain
|
||||
@@ -3,5 +3,10 @@
|
||||
"packages/*"
|
||||
],
|
||||
"version": "independent",
|
||||
"npmClient": "yarn"
|
||||
"npmClient": "yarn",
|
||||
"command": {
|
||||
"version": {
|
||||
"message": "chore(release): publish"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
"lint": "yarn lint:eslint && yarn lint:prettier",
|
||||
"lint:eslint": "eslint --ext .ts,.tsx . -f unix",
|
||||
"lint:fix": "eslint --ext .ts,.tsx . -f unix --fix && prettier --write **/*.{ts,tsx} *.js",
|
||||
"lint:prettier": "prettier --check **/*.{ts,tsx} *.js"
|
||||
"lint:prettier": "prettier --check **/*.{ts,tsx} *.js",
|
||||
"version": "lerna bootstrap"
|
||||
},
|
||||
"prettier": "@blockstack/prettier-config",
|
||||
"husky": {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"test:coverage": "jest --collect-coverage",
|
||||
"test:watch": "jest --watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"version": "yarn",
|
||||
"watch": "cross-env NODE_ENV=development EXT_ENV=watch webpack -d"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
|
||||
@@ -79,7 +79,8 @@
|
||||
"prepublishOnly": "yarn build",
|
||||
"start": "tsdx watch",
|
||||
"test": "tsdx test",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --noEmit",
|
||||
"version": "yarn"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"typings": "dist/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user