Skip to content

Commit 0f07be3

Browse files
author
fanwenjie
committed
chore: publish command
chore: publish & release command chore: publish & release command chore: publish & release command chore: publish & release command chore: publish & release pipeline chore: publish & release pipeline chore: Publish feat/rush-change-plugin Revert "chore: Publish feat/rush-change-plugin" This reverts commit 9c82faf. chore: publish & release pipeline chore: publish & release pipeline chore: publish & release pipeline
1 parent 29ebb3e commit 0f07be3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4620
-24
lines changed

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- '**/*'
7+
8+
jobs:
9+
publish:
10+
strategy:
11+
matrix:
12+
include:
13+
- NodeVersion: 20.14.x
14+
NodeVersionDisplayName: 20
15+
OS: ubuntu-latest
16+
name: Node.js v${{ matrix.NodeVersionDisplayName }} (${{ matrix.OS }})
17+
runs-on: ${{ matrix.OS }}
18+
if: github.repository == 'coze-dev/rush-arch'
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Check Release Tag
25+
id: check_tag
26+
run: |
27+
HAS_VALID_TAG=$(git tag --points-at HEAD | grep -E "^v/.+/.+$" || true)
28+
if [ ! -z "$HAS_VALID_TAG" ]; then
29+
echo "has_valid_tag=true" >> $GITHUB_OUTPUT
30+
echo "Found valid tag: $HAS_VALID_TAG"
31+
else
32+
echo "has_valid_tag=false" >> $GITHUB_OUTPUT
33+
echo "No valid tag found"
34+
fi
35+
36+
- name: Config Git User
37+
if: steps.check_tag.outputs.has_valid_tag == 'true'
38+
run: |
39+
git config --local user.name "tecvan"
40+
git config --local user.email "[email protected]"
41+
42+
- uses: actions/setup-node@v3
43+
if: steps.check_tag.outputs.has_valid_tag == 'true'
44+
with:
45+
node-version: ${{ matrix.NodeVersion }}
46+
registry-url: 'https://registry.npmjs.org'
47+
node-version-file: '.nvmrc'
48+
49+
- name: Cache
50+
if: steps.check_tag.outputs.has_valid_tag == 'true'
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
common/temp/pnpm-local
55+
common/temp/pnpm-store
56+
common/temp/install-run
57+
key: ${{ runner.os }}-rush-store-${{ hashFiles('common/config/subspaces/**/pnpm-lock.yaml') }}
58+
restore-keys: |
59+
${{ runner.os }}-rush-store-main
60+
${{ runner.os }}-rush-store
61+
62+
- name: Install Dependencies
63+
if: steps.check_tag.outputs.has_valid_tag == 'true'
64+
run: |
65+
npm i -g @microsoft/[email protected]
66+
sudo apt-get update
67+
sudo apt-get install -y libasound2-dev
68+
node common/scripts/install-run-rush.js install
69+
70+
- name: Run Release
71+
if: steps.check_tag.outputs.has_valid_tag == 'true'
72+
run: node common/scripts/install-run-rush.js release --commit ${{ github.event.head_commit.id }}
73+
env:
74+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

common/autoinstallers/plugins/rush-plugins/@coze-infra/rush-publish-plugin/@coze-infra/rush-publish-plugin/command-line.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,111 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
33
"commands": [
4+
{
5+
"name": "pub",
6+
"commandKind": "global",
7+
"summary": "⭐️️ Publish packages to npm",
8+
"shellCommand": "rush-publish pub",
9+
"safeForSimultaneousRushProcesses": true
10+
},
411
{
512
"name": "change-x",
613
"commandKind": "global",
714
"summary": "⭐️️ generate change log",
815
"shellCommand": "rush-publish change",
916
"safeForSimultaneousRushProcesses": true
17+
},
18+
{
19+
"name": "release",
20+
"commandKind": "global",
21+
"summary": "⭐️️ release packages",
22+
"shellCommand": "rush-publish release",
23+
"safeForSimultaneousRushProcesses": true
1024
}
1125
],
1226
"parameters": [
27+
{
28+
"parameterKind": "string",
29+
"description": "Enable dry run mode",
30+
"shortName": "-d",
31+
"longName": "--dry-run",
32+
"argumentName": "DRY_RUN",
33+
"associatedCommands": ["pub"],
34+
"required": false
35+
},
36+
{
37+
"parameterKind": "string",
38+
"shortName": "-t",
39+
"longName": "--to",
40+
"description": "Publish specified packages and their downstream dependencies",
41+
"argumentName": "TO",
42+
"associatedCommands": ["pub"],
43+
"required": false
44+
},
45+
{
46+
"parameterKind": "string",
47+
"shortName": "-f",
48+
"longName": "--from",
49+
"description": "Publish specified packages and their upstream/downstream dependencies",
50+
"argumentName": "FROM",
51+
"associatedCommands": ["pub"],
52+
"required": false
53+
},
54+
{
55+
"parameterKind": "string",
56+
"shortName": "-o",
57+
"longName": "--only",
58+
"description": "Only publish specified packages",
59+
"argumentName": "ONLY",
60+
"associatedCommands": ["pub"],
61+
"required": false
62+
},
63+
{
64+
"parameterKind": "flag",
65+
"shortName": "-s",
66+
"longName": "--skip-commit",
67+
"description": "Skip git commit",
68+
"associatedCommands": ["pub"],
69+
"required": false
70+
},
71+
{
72+
"parameterKind": "flag",
73+
"shortName": "-p",
74+
"longName": "--skip-push",
75+
"description": "Skip git push",
76+
"associatedCommands": ["pub"],
77+
"required": false
78+
},
79+
{
80+
"parameterKind": "choice",
81+
"alternatives": [
82+
{
83+
"name": "alpha",
84+
"description": "Alpha version"
85+
},
86+
{
87+
"name": "beta",
88+
"description": "Beta version"
89+
},
90+
{
91+
"name": "patch",
92+
"description": "Patch version"
93+
},
94+
{
95+
"name": "minor",
96+
"description": "Minor version"
97+
},
98+
{
99+
"name": "major",
100+
"description": "Major version"
101+
}
102+
],
103+
"shortName": "-b",
104+
"longName": "--bump-type",
105+
"description": "Version bump type (alpha/beta/patch/minor/major)",
106+
"associatedCommands": ["pub"],
107+
"required": false
108+
},
13109
{
14110
"parameterKind": "flag",
15111
"longName": "--amend-commit",
@@ -31,6 +127,14 @@
31127
"shortName": "-c",
32128
"description": "本次提交信息,默认读取 .git/COMMIT_EDITMSG",
33129
"associatedCommands": ["change-x"]
130+
},
131+
{
132+
"parameterKind": "string",
133+
"argumentName": "COMMIT",
134+
"longName": "--commit",
135+
"shortName": "-c",
136+
"description": "Git commit hash",
137+
"associatedCommands": ["release"]
34138
}
35139
]
36140
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "publish & release command",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "publish & release command",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "publish & release command",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "publish & release pipeline",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "publish & release pipeline",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "publish & release pipeline",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-run-tsc-plugin",
5+
"comment": "publish & release command",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-run-tsc-plugin",
10+
"email": "[email protected]"
11+
}

0 commit comments

Comments
 (0)