-
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
hubert
committed
Jul 25, 2024
1 parent
b04b412
commit d28f6af
Showing
3 changed files
with
108 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,22 @@ | ||
name: Check PR title | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
|
||
permissions: | ||
statuses: write | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: aslafy-z/conventional-pr-title-action@v3 | ||
with: | ||
preset: "@commitlint/config-conventional@^12.1.4" | ||
env: | ||
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,26 @@ | ||
name: Check Commit spec | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0= | ||
- uses: wagoid/commitlint-github-action@v3 | ||
env: | ||
NODE_PATH: ${{ github.workspace }}/node_modules |
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,60 @@ | ||
name: Deploy | ||
|
||
on: | ||
# release: | ||
# types: [published] | ||
push: # push 到主分支自动 发布 | ||
branches: ['master'] | ||
paths-ignore: # 忽略一些不必要的文件 | ||
- '.gitignore' | ||
- 'README.md' | ||
- '.vscode/**' | ||
- '.devcontainer/**' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: 'production' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.14' | ||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: | | ||
node_modules | ||
.yarn/cache | ||
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install Dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: yarn install --mode=skip-build | ||
- name: Configure Git User | ||
run: | | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
git config --global user.name "${{github.actor}}" | ||
git config --list | ||
- name: Authenticate with Registry | ||
run: | | ||
echo "registry=https://registry.npmjs.org/" >> .npmrc | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | ||
npm whoami | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Publish | ||
run: | | ||
npx lerna publish --yes | ||
env: | ||
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} |