-
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.69 KB
/
Copy pathci.yml
File metadata and controls
97 lines (83 loc) · 2.69 KB
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
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
always-auth: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Cache ESLint dependencies
uses: actions/cache@v4
with:
path: ./packages/react-runtime/.cache/eslint
key: ${{ runner.os }}-eslint-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/.eslintrc.cjs') }}
restore-keys: |
${{ runner.os }}-eslint-
- name: Cache Playwright browsers
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install Playwright browsers
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: yarn playwright:install
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: Dry Run Semantic Release & Pack
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(npx semantic-release --dry-run | grep "The next release version is" | awk '{print $NF}')
rm -rf /tmp/releases/react-runtime
mkdir -p /tmp/releases/react-runtime
cd ./packages/react-runtime
npm pack --pack-destination /tmp/releases/react-runtime
cd /tmp/releases/react-runtime
mv *.tgz react-runtime-v$VERSION.tgz
tar -xzf react-runtime-v$VERSION.tgz
zip -r react-runtime-v$VERSION.zip package
rm -rf package
- name: Release with semantic-release
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release