This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
60 lines (57 loc) · 1.74 KB
/
windows.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
name: Windows
on:
push:
tags:
- "v*.*.*"
pull_request:
branches:
- master
- next
paths:
- '.github/workflows/windows.yml'
- 'dist.js'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: false
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn cache
uses: actions/cache@v2
id: cache-yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# npm-14-bundled node-gyp (5.x) can't find VS2022 used by GH Actions
# https://github.com/nodejs/node-gyp/issues/2520
- name: Upgrade node-gyp
run: |
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
shell: powershell
# https://github.com/mui-org/material-ui/issues/12432
- run: yarn --prefer-offline --network-timeout 600000
- run: yarn lint
- run: yarn test
- name: Get tag name
run: echo CI_BUILD_TAG=${GITHUB_REF/refs\/tags\//} >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')
shell: bash
- run: yarn dist
env:
CI: true
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
if: startsWith(github.ref, 'refs/tags/')