Skip to content

Commit

Permalink
fix: 调整自动发包凭证,确保功能正常
Browse files Browse the repository at this point in the history
  • Loading branch information
codetker committed Sep 9, 2024
1 parent a0c0c27 commit bef9340
Show file tree
Hide file tree
Showing 6 changed files with 2,820 additions and 2,702 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/mr_publish_alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@ on:
branches:
- main
types: [opened, synchronize, reopened]

jobs:
publish-alpha:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# with:
# ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: npx yarn

- name: Setup git userName
run: git config user.name 'codetker'
run: git config user.name 'yukilzw'

- name: Setup git userEmail
run: git config user.email 'codetker@sina.com'
run: git config user.email 'liuzhanwei@bytedance.com'

- name: Lerna Version alpha
run: npx lerna version prerelease --preid=alpha --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Lerna Publish Alpha
run: npx lerna publish from-package --dist-tag alpha --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 19 additions & 3 deletions .github/workflows/mr_run_jest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Jest

env:
ACTIONS_STEP_DEBUG: true

on:
pull_request:
branches:
Expand All @@ -11,19 +14,32 @@ jobs:
runs-on: ubuntu-latest

steps:
# - name: Display debug information # to debug
# run: |
# echo "Current GitHub context:"
# echo "${{ toJson(github) }}"

- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# with:
# ref: ${{github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"

- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: npx yarn

- name: Run Jest
run: npx yarn test
run: npx yarn test --coverage
23 changes: 11 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: Publish Release
name: Publish Release

on:
push:
branches:
- main

jobs:

publish-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout Branch
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
uses: actions/checkout@v4
# with:
# ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: npx yarn

- name: Setup git userName
run: git config --global user.name 'codetker'
run: git config user.name 'yukilzw'

- name: Setup git userEmail
run: git config --global user.email 'codetker@sina.com'
run: git config user.email 'liuzhanwei@bytedance.com'

- name: Lerna Version
run: npx lerna version patch --yes
Expand All @@ -44,4 +43,4 @@ jobs:
run: npx lerna publish from-package --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
registry="https://registry.npmjs.org/"
registry="https://registry.npmjs.org/"

# registry "https://registry.npm.taobao.org" # Set this if you want to use taobao registry or install failed
3 changes: 3 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry "https://registry.npmjs.org/"

# registry "https://registry.npm.taobao.org" # Set this if you want to use taobao registry or install failed
Loading

0 comments on commit bef9340

Please sign in to comment.