-
-
Notifications
You must be signed in to change notification settings - Fork 10
148 lines (128 loc) · 5.06 KB
/
Publish.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Publish
on:
push:
branches: ["main", "beta"]
pull_request:
branches: ["main", "beta", "next"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x, 20.x]
os: [ubuntu-latest]
steps:
- name: Begin CI
uses: actions/checkout@v2
#----------------------------------------------
# Setup Kernel for React Native
#----------------------------------------------
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
#----------------------------------------------
# Setup Node Environment
#----------------------------------------------
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
#----------------------------------------------
# Cache modules
#----------------------------------------------
- name: Use cached node_modules
uses: actions/cache@v1
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
#----------------------------------------------
# Install Dependencies
#----------------------------------------------
- name: Install dependencies
run: yarn install --frozen-lockfile
#----------------------------------------------
# Run unit tests
#----------------------------------------------
- name: Test
run: yarn testFinal
publish:
if: ${{github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')}}
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
#----------------------------------------------
# Setup Node Environment
#----------------------------------------------
- name: Use NodeJs 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x
#----------------------------------------------
# Cache modules
#----------------------------------------------
- name: Use cached node_modules
uses: actions/cache@v1
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
#----------------------------------------------
# Install dependencies
#----------------------------------------------
- name: Install dependencies
run: yarn install --frozen-lockfile
#----------------------------------------------
# Run unit tests
#----------------------------------------------
- name: Test
run: yarn testFinal
#----------------------------------------------
# Store coverage
#----------------------------------------------
- name: Upload coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@1.0.0
with:
# API project token to retrieve your remote Codacy configuration for the project being analyzed
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# Optional comma separated list of coverage reports to send to Codacy
coverage-reports: ./coverage/lcov.info
#----------------------------------------------
# Build dist package
#----------------------------------------------
- name: Build
run: yarn prepare
# #----------------------------------------------
# # Codacy Security Analysis
# #----------------------------------------------
# - name: Run Codacy Analysis CLI
# uses: codacy/codacy-analysis-cli-action@1.1.0
# with:
# # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# # You can also omit the token and run the tools that support default configurations
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# verbose: true
# output: results.sarif
# format: sarif
# # Adjust severity of non-security issues
# gh-code-scanning-compat: true
# # Force 0 exit code to allow SARIF file generation
# # This will handover control about PR rejection to the GitHub side
# max-allowed-issues: 2147483647
# #----------------------------------------------
# # Upload the SARIF file generated in the previous step
# #----------------------------------------------
# - name: Upload SARIF results file
# uses: github/codeql-action/upload-sarif@v1
# with:
# sarif_file: results.sarif
#----------------------------------------------
# Publish package
#----------------------------------------------
- name: Semantic Release
run: yarn semantic-release
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}