-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (53 loc) · 1.71 KB
/
mr_publish_alpha.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Publish Alpha
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
jobs:
publish-alpha:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
# - name: Display debug information # to debug
# run: |
# echo "Current GitHub context:"
# echo "${{ toJson(github) }}"
- name: Check if branch exists
id: check_branch
run: |
BRANCH_NAME="${{ github.head_ref }}"
if git show-ref --verify --quiet refs/heads/"$BRANCH_NAME"; then
echo "Branch '$BRANCH_NAME' exists."
echo "exists=true" >> $GITHUB_ENV
else
echo "Branch '$BRANCH_NAME' does not exist.It is a pull request across repos."
exit 1
fi
- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
run: npx yarn
- name: Setup git userName
run: git config user.name 'yukilzw'
- name: Setup git userEmail
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 }}