-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
6336987
commit dcd2ba8
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
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,36 @@ | ||
name: "CI Check" | ||
|
||
on: | ||
pull_request: | ||
branches: ["main"] | ||
|
||
# Cancel prev CI if new commit come | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: [self-hosted, linux] | ||
strategy: | ||
matrix: | ||
node: [16] | ||
name: Run Test on Node ${{ matrix.node }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Setup yarn | ||
run: npm install -g yarn | ||
- name: Install deps | ||
run: yarn install --frozen-lockfile | ||
timeout-minutes: 15 | ||
- name: Go to refine | ||
run: cd packages/refine | ||
- name: Test | ||
run: yarn jest | ||
- name: Build | ||
run: yarn build |
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,48 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: [self-hosted, linux] | ||
strategy: | ||
matrix: | ||
node: [16] | ||
name: Publish on Node ${{ matrix.node }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Setup yarn | ||
run: npm install -g yarn | ||
- name: Install deps | ||
run: yarn install --frozen-lockfile | ||
timeout-minutes: 15 | ||
- name: Go to refine | ||
run: cd packages/refine | ||
- name: Build | ||
run: yarn build | ||
- name: Write .npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.MY_NPM_TOKEN }} | ||
run: | | ||
echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > ~/.npmrc | ||
- name: Publish | ||
uses: nick-fields/retry@v2 | ||
with: | ||
timeout_minutes: 10 # 设置超时时间,单位为分钟 | ||
max_attempts: 3 # 设置最大重试次数 | ||
command: | | ||
npm publish | ||
- name: sync cnpm | ||
run: curl --location --request PUT 'http://192.168.26.29:7002/sync/@dovetail-v2/refine?sync_upstream=true' | ||
- name: Clean .npmrc | ||
if: always() | ||
run: rm ~/.npmrc |