-
Notifications
You must be signed in to change notification settings - Fork 20
52 lines (52 loc) · 1.72 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
name: release
on:
push:
branches:
- main
jobs:
call-build-lint-test-workflow:
uses: ./.github/workflows/build-lint-test.yml
deploy-package:
runs-on: ubuntu-latest
needs: [call-build-lint-test-workflow]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: actions/cache@v2
id: css-in-js-cache
name: Cache css in js files
with:
path: |
packages/module/src/css
key: ${{ runner.os }}-css-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('packages/module/src/css/*') }}
- name: generate
run: cd packages/module && yarn generate
if: steps.css-in-js-cache.outputs.cache-hit != 'true'
- uses: actions/cache@v2
id: dist
name: Cache dist
with:
path: |
packages/*/dist
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
- name: Build dist
run: yarn build
if: steps.dist.outputs.cache-hit != 'true'
- name: Release to NPM
run: cd packages/module && npx [email protected]