Skip to content

Commit 07cdd7d

Browse files
committed
chore: add publish actions
1 parent 5f77d6f commit 07cdd7d

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed

.github/workflows/publish beta npm.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,14 @@ jobs:
2424
with:
2525
node-version: '16' # 或者您希望的任何版本
2626

27-
- name: Configure Git
27+
- name: Change to Package Directory
2828
run: |
2929
git config --local user.email "action@github.com"
3030
git config --local user.name "GitHub Action"
31-
32-
- name: Change to Package Directory
33-
run: cd packages/${{ github.event.inputs.packagePath }}
34-
35-
- name: Install Package Dependencies
36-
run: npm install
37-
38-
- name: Build Package
39-
run: npm run build
40-
41-
- name: Update Package Version
42-
run: npm version ${{ github.event.inputs.betaVersion }}
43-
44-
- name: Publish Package
45-
run: |
4631
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
47-
npm publish
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 确保在您的 GitHub 仓库的 Secrets 中设置了 NPM_TOKEN
32+
cd packages/${{ github.event.inputs.packagePath }}
33+
npm install --legacy-peer-deps
34+
npm run build
35+
npm version ${{ github.event.inputs.betaVersion }}
36+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
37+
npm publish --tag beta

.github/workflows/publish npm.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@ jobs:
3535
run: cd packages/${{ github.event.inputs.packagePath }}
3636

3737
- name: Install Package Dependencies
38-
run: npm install
38+
run: npm install --legacy-peer-deps
3939

4040
- name: Build Package
4141
run: npm run build
4242

4343
- name: Publish Package
4444
run: |
45+
git config --local user.email "action@github.com"
46+
git config --local user.name "GitHub Action"
47+
48+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
49+
cd packages/${{ github.event.inputs.packagePath }}
50+
npm install --legacy-peer-deps
4551
npm version patch
52+
npm run build
4653
4754
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
4855
npm publish
@@ -51,7 +58,4 @@ jobs:
5158
echo "::set-output name=PACKAGE_VERSION::$(node -p "require('./package.json').version")"
5259
5360
git tag -a "${{ steps.package_info.outputs.PACKAGE_NAME }}@${{ steps.package_info.outputs.PACKAGE_VERSION }}" -m "Release ${{ steps.package_info.outputs.PACKAGE_NAME }} version ${{ steps.package_info.outputs.PACKAGE_VERSION }}"
54-
git push origin "${{ steps.package_info.outputs.PACKAGE_NAME }}@${{ steps.package_info.outputs.PACKAGE_VERSION }}"
55-
56-
env:
57-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 确保在您的 GitHub 仓库的 Secrets 中设置了 NPM_TOKEN
61+
git push origin "${{ steps.package_info.outputs.PACKAGE_NAME }}@${{ steps.package_info.outputs.PACKAGE_VERSION }}"

packages/plugin-test/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
],
2020
"dependencies": {
2121
"@alilc/lowcode-utils": "^1.0.0",
22-
"@alilc/lowcode-types": "^1.1.9",
23-
"react": "^16.8.1",
24-
"react-dom": "^16.8.1"
22+
"@alilc/lowcode-types": "^1.1.9"
2523
},
2624
"devDependencies": {
2725
"@alib/build-scripts": "^0.1.3",
@@ -30,7 +28,11 @@
3028
"@types/react": "^16.9.13",
3129
"@types/react-dom": "^16.9.4",
3230
"build-plugin-fusion": "^0.1.22",
33-
"build-plugin-moment-locales": "^0.1.0"
31+
"build-plugin-moment-locales": "^0.1.0",
32+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
33+
"react": "^16.8.1",
34+
"webpack": "^5.64.4",
35+
"react-dom": "^16.8.1"
3436
},
3537
"publishConfig": {
3638
"registry": "https://registry.npmjs.org/",
@@ -39,6 +41,6 @@
3941
"repository": {
4042
"type": "git",
4143
"url": "https://github.com/alibaba/lowcode-plugins.git",
42-
"directory": "packages/plugin-undo-redo"
44+
"directory": "packages/plugin-test"
4345
}
4446
}

0 commit comments

Comments
 (0)