Skip to content

Commit

Permalink
ci(CI&CD): 🎡 upgrade CI
Browse files Browse the repository at this point in the history
  • Loading branch information
guotingchao committed Apr 23, 2024
1 parent 2f44f7d commit 7936195
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 55 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-rivers-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cardbrother/nestjs-tencent-cloud-sdk": patch
---

更新CI流程
57 changes: 3 additions & 54 deletions .github/workflows/CI.yml → .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,16 @@
name: Release
env:
STORE_PATH: ""
name: Release & Publish
on:
push:
branches:
- develop
- main
defaults:
run:
shell: bash

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

test:
name: Test
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm run test

build:
name: Build
runs-on: ubuntu-latest
needs: [prepare, test]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -96,7 +45,7 @@ jobs:
release:
name: Release & Publish
runs-on: ubuntu-latest
needs: [prepare, test, build]
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test
on:
push:
branches:
- "**"
- "!main"
- "!master"
pull_request:
branches:
- "**"
- "!main"
- "!master"
defaults:
run:
shell: bash

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

test:
name: Test
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm run test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"release": "pnpm release:check && pnpm release:version && pnpm release:publish",
"release:changelog": "pnpm changeset",
"release:check": "pnpm lint",
"release:publish": "pnpm -r publish --tag latest",
"release:publish": "pnpm changeset publish",
"release:version": "pnpm changeset version",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
Expand Down

0 comments on commit 7936195

Please sign in to comment.