Skip to content

Commit da6c406

Browse files
authored
Merge pull request #89 from cloudcome/feat/v0.x
Feat/v0.x 2023-03-17 17:13:47
2 parents 9c38446 + 5ae3eb1 commit da6c406

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/actions/npm-publish/action.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: npm publish
2-
description: |
3-
按仓库类型执行 npm publish,可以将包发布到 npm、github 等仓库
2+
description: 按仓库类型执行 npm publish,可以将包发布到 npm、github 等仓库,
43
如果是发布到 github 则会将 package.name 替换为 @${{ github.repository }}
54

65
inputs:
@@ -15,22 +14,22 @@ runs:
1514
using: composite
1615
steps:
1716
- name: 仓库类型是 github
18-
if: inputs.type == "github"
17+
if: inputs.type == 'github'
1918
run: |
2019
echo "//npm.pkg.github.com/:_authToken=${{ github.token }}" > .npmrc
2120
echo "registry=https://npm.pkg.github.com/" >> .npmrc
2221
echo "always-auth=true" >> .npmrc
2322
shell: bash
2423
- name: 修改 package.json name 为 @${{ github.repository }}
25-
if: inputs.type == "github"
24+
if: inputs.type == 'github'
2625
uses: jaywcjlove/github-action-package@main
2726
with:
2827
data: |
2928
{
3029
"name": "@${{ github.repository }}"
3130
}
3231
- name: 仓库类型是 npm
33-
if: inputs.type == "npm"
32+
if: inputs.type == 'npm'
3433
run: |
3534
echo "//registry.npmjs.org/:_authToken=${{ inputs.token }}" > .npmrc
3635
echo "registry=https://registry.npmjs.org/" >> .npmrc
@@ -39,9 +38,9 @@ runs:
3938
- run: npm publish
4039
shell: bash
4140
- id: pkg
42-
if: inputs.type == "npm"
41+
if: inputs.type == 'npm'
4342
uses: jaywcjlove/github-action-package@main
4443
- name: 同步新版本到 npmmirror.com
45-
if: inputs.type == "npm"
44+
if: inputs.type == 'npm'
4645
run: curl --silent -X PUT https://registry-direct.npmmirror.com/${{ steps.pkg.outputs.name }}/sync?sync_upstream=true
4746
shell: bash

0 commit comments

Comments
 (0)