This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (125 loc) · 3.52 KB
/
ci.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
name: CI
on:
push:
branches:
- 'main'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'main'
env:
NODE_VERSION: "18"
jobs:
deps:
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE_VERSION }}"
cache: "yarn"
- name: Deps
run: scripts/deps
env:
LOCK: true
- name: Archive Modules
timeout-minutes: 5
uses: actions/cache/save@v3
with:
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: |
${{ github.workspace }}/node_modules
ci-hosted:
needs:
- deps
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE_VERSION }}"
cache: "yarn"
- name: Unarchive Modules
timeout-minutes: 5
uses: actions/cache/restore@v3
with:
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: |
${{ github.workspace }}/node_modules
- name: Build
run: scripts/build
env:
COS_BUCKET: "${{ secrets.COS_BUCKET }}"
COS_REGION: "${{ secrets.COS_REGION }}"
- name: Release
uses: TencentCloud/cos-action@b0aa648235fb35a1bdd6a77f529eb0ac4c2f1c25
if: github.event_name == 'push'
with:
secret_id: "${{ secrets.CI_TECENTCOS_SECRET_ID }}"
secret_key: "${{ secrets.CI_TECENTCOS_SECRET_KEY }}"
cos_bucket: "${{ secrets.COS_BUCKET }}"
cos_region: "${{ secrets.COS_REGION }}"
local_path: dist
remote_path: latest
accelerate: true
clean: false
ci-emebeded:
needs:
- deps
if: github.event_name == 'push'
timeout-minutes: 30
runs-on: ubuntu-22.04
strategy:
matrix:
version: [ "latest", "${{ github.ref_name }}" ]
exclude:
- version: "main"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
persist-credentials: false
- name: Setup Node
timeout-minutes: 5
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE_VERSION }}"
cache: "yarn"
- name: Unarchive Node Modules
timeout-minutes: 5
uses: actions/cache/restore@v3
with:
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: |
${{ github.workspace }}/node_modules
- name: Build
run: scripts/build
- name: Package
run: scripts/package
env:
VERSION: "${{ matrix.version }}"
- name: Release
uses: TencentCloud/cos-action@b0aa648235fb35a1bdd6a77f529eb0ac4c2f1c25
with:
secret_id: ${{ secrets.CI_TECENTCOS_SECRET_ID }}
secret_key: ${{ secrets.CI_TECENTCOS_SECRET_KEY }}
cos_bucket: ${{ secrets.COS_BUCKET }}
cos_region: ${{ secrets.COS_REGION }}
local_path: dist/${{ matrix.version }}.tar.gz
remote_path: releases/${{ matrix.version }}.tar.gz
accelerate: true
clean: false