-
Notifications
You must be signed in to change notification settings - Fork 666
148 lines (125 loc) · 3.94 KB
/
build-macos.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: Build MacOS Dev
on:
workflow_dispatch:
inputs:
tags:
description: "Version tags"
env:
VERSION: 0.9.0
jobs:
build:
strategy:
matrix:
go: [1.21.1]
runs-on: "macos-12"
steps:
- name: Install coscmd
run: |
sudo /Library/Frameworks/Python.framework/Versions/3.11/bin/python -m pip install --upgrade pip
sudo pip3 install coscmd
echo "/Library/Frameworks/Python.framework/Versions/3.11/bin" >> $GITHUB_PATH
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
run: npm install -g pnpm
- name: Setup Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout Kun
uses: actions/checkout@v3
with:
repository: yaoapp/kun
path: kun
- name: Checkout Xun
uses: actions/checkout@v3
with:
repository: yaoapp/xun
path: xun
- name: Checkout Gou
uses: actions/checkout@v3
with:
repository: yaoapp/gou
# ref: dc3d98411f61e21cf775e4c82d92d5ac2acfc03c
path: gou
- name: Checkout V8Go
uses: actions/checkout@v3
with:
repository: rogchap/v8go
# ref: aac4923ed74083e58ae7b42b1acb0fa0d11a26cb
path: v8go
- name: Checkout XGen v1.0
uses: actions/checkout@v3
with:
repository: yaoapp/xgen
# ref: 408470b84c9d6bb8ed988b545b6e46ffc2872014
path: xgen-v1.0
- name: Checkout Yao-Init
uses: actions/checkout@v3
with:
repository: yaoapp/yao-init
path: yao-init
- name: Move Kun, Xun, Gou, UI, V8Go
run: |
mv kun ../
mv xun ../
mv gou ../
mv v8go ../
mv xgen-v1.0 ../
mv yao-init ../
rm -f ../xgen-v1.0/packages/setup/vite.config.ts.*
ls -l .
ls -l ../
ls -l ../xgen-v1.0/packages/setup/
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Setup Go Tools
run: |
make tools
- name: Get Version
run: |
echo VERSION=$(cat share/const.go |grep 'const VERSION' | awk '{print $4}' | sed "s/\"//g") >> $GITHUB_ENV
- name: Make Artifacts MacOS
run: |
make artifacts-macos
mv dist/release/yao-$VERSION-dev-darwin-arm64 dist/release/yao-$VERSION-unstable-darwin-arm64
mv dist/release/yao-$VERSION-dev-darwin-amd64 dist/release/yao-$VERSION-unstable-darwin-amd64
- name: Configure COS For Silicon Valley
env:
SECRET_ID: ${{ secrets.COS_ID }}
SECRET_KEY: ${{ secrets.COS_KEY }}
BUCKET: release-sv-1252011659
REGION: na-siliconvalley
run: |
coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION
- name: Push To Silicon Valley
run: |
for file in ./dist/release/*; do coscmd upload $file /archives/; done;
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: yao-macos
path: |
dist/release/*
# - name: Configure COS For Beijing
# env:
# SECRET_ID: ${{ secrets.COS_ID }}
# SECRET_KEY: ${{ secrets.COS_KEY }}
# BUCKET: release-bj-1252011659
# REGION: ap-beijing
# run: |
# coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION
# - name: Push To Beijing
# run: |
# for file in ./dist/release/*; do coscmd upload $file /archives/; done;