-
-
Notifications
You must be signed in to change notification settings - Fork 45
71 lines (56 loc) · 1.92 KB
/
release.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
66
67
68
69
70
71
name: CI/CD
on:
push:
branches:
- main
- feat_sync
jobs:
build:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: dependencies cache
uses: actions/cache@v3
with:
path: |
~/.npm
~/.cache
~/node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Debug NPM_TOKEN
run: |
echo "NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}"
echo "NPM_TOKEN_EMPTY: ${{ secrets.NPM_TOKEN_EMPTY }}"
- name: Yarn install
run: yarn install
- name: Run Packages Tests
run: |
ls -la
# yarn run test skip
- name: Build Packages
run: |
npx lerna exec --scope='@pagenote/*' --no-private --include-dependencies yarn build
- name: Set Git Identity
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
#https://github.com/lerna/lerna/tree/main/libs/commands/version#semver-bump
- name: Lerna Version
run: |
npx lerna version prepatch --amend --conventional-commits --conventional-prerelease --yes
# npx lerna version --no-push --no-private patch --yes
- name: Create .npmrc
run: echo 'registry=https://registry.npmjs.org' > ~/.npmrc && echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> ~/.npmrc
# https://github.com/lerna/lerna/tree/main/libs/commands/publish#readme
- name: Publish to NPM
run: |
npx lerna publish from-git --yes
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}