fix(project): fix/release-automation (#1101)

- Fix publish scripts
This commit is contained in:
jeremywu 2020-12-23 21:44:51 +08:00 committed by GitHub
parent 2e53ce72c9
commit a65b7232cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -10,7 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '12'
- name: Install dependencies
run: yarn bootstrap
- name: Lint
@ -23,8 +25,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12'
registry-url: https://registry.npmjs.org/
- name: Get version
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
@ -35,7 +38,7 @@ jobs:
- name: Publish
run: sh ./scripts/publish.sh
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
TAG_VERSION: ${{env.TAG_VERSION}}
REGISTRY: https://npm.pkg.github.com/
@ -44,9 +47,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '12'
registry-url: https://npm.pkg.github.com/
- name: Get version
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
@ -57,6 +60,6 @@ jobs:
- name: Publish
run: sh ./scripts/publish.sh
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
TAG_VERSION: ${{env.TAG_VERSION}}
REGISTRY: https://npm.pkg.github.com/

View File

@ -3,9 +3,6 @@
# Do not run this file without setting the environment variables, you will end up fatal error
# If you wish to run this locally, please change the env variable before running this.
WORKING_PATH="../$(dirname $0)"
cd ..
cat package.json | grep -v '"private":' | grep -v '"version":' | sed "s/\(\"name\": \"element-plus\"\)/\1,\n \"version\": \"${TAG_VERSION}\"/g" > package.json
cat package.json | grep -v '"private":' | grep -v '"version":' | sed "s/\(\"name\": \"@element-plus\/icons\"\)/\1,\n \"version\": \"${TAG_VERSION}\"/g" > package.json
npm publish --registry ${REGISTRY} --access public
npm publish --registry ${REGISTRY} --access public