-
-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (127 loc) · 4.2 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Release
on:
push:
branches:
- main
env:
CI: true
NODE_VERSION: 20.x
NPM_SITE: https://registry.npmjs.org
jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
always-auth: true
registry-url: 'https://registry.npmjs.org'
scope: "@berviantoleo"
- name: Restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: corepack enable && corepack prepare yarn@stable --activate && yarn --immutable
- name: Build Package
run: yarn lerna run build --scope @berviantoleo/react-multi-crop
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn lerna publish --yes
- name: Build Demo
run: yarn lerna run build --scope @berviantoleo/react-multi-crop-demo
env:
SKIP_PREFLIGHT_CHECK: true
PUBLIC_URL: /
DISABLE_ESLINT_PLUGIN: true
- name: Publish Demo
uses: JamesIves/github-pages-deploy-action@v4.6.8
with:
branch: demo # The branch the action should deploy to.
folder: examples/demo/build # The folder the action should deploy.
single-commit: true
docs:
name: Publish Docs
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
always-auth: true
- name: Restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: corepack enable && corepack prepare yarn@stable --activate && yarn --immutable
- name: Build Documentation
run: |
yarn docs
yarn lerna run docs --scope @berviantoleo/react-multi-crop
- name: Deploy Docs 🚀
uses: JamesIves/github-pages-deploy-action@v4.6.8
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
single-commit: true
coverage:
name: Coverage Upload
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
always-auth: true
- name: Restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: corepack enable && corepack prepare yarn@stable --activate && yarn --immutable
- name: Lint
run: yarn lint
- name: Test & Build Package
run: |
yarn lerna run test --scope @berviantoleo/react-multi-crop
yarn lerna run build --scope @berviantoleo/react-multi-crop
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required