-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
839 additions
and
104 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: build | ||
|
||
# 触发条件:在 push或合并请求 到 master 或 release开头的分支后 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- alpha | ||
- beta | ||
pull_request: | ||
branches: '*' | ||
|
||
# 任务 | ||
jobs: | ||
quality: | ||
# 服务器环境:最新版 Ubuntu | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 拉取代码 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.12.x | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
|
||
# 执行测试和打包操作 | ||
- name: Install deps | ||
run: npm ci | ||
|
||
- name: Lint check | ||
run: npm run lint | ||
|
||
# 这条命令包含了测试 | ||
- name: Unit tests | ||
run: npm run test | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [quality] | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
steps: | ||
# 拉取代码 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.12.x | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
|
||
# 执行测试和打包操作 | ||
- name: Install deps | ||
run: npm ci | ||
|
||
# 这条命令包含了测试和上传覆盖率 | ||
- name: Coverage | ||
run: npm run coveralls | ||
|
||
# 打包发布 | ||
- name: Build | ||
run: npm run build --if-present | ||
|
||
- name: Release | ||
run: npm run release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
branches: | ||
- main | ||
- name: beta | ||
prerelease: true | ||
- name: alpha | ||
prerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'] | ||
}; |
Oops, something went wrong.