-
Notifications
You must be signed in to change notification settings - Fork 1.5k
148 lines (126 loc) · 3.8 KB
/
casa.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
# This is a basic workflow to help you get started with Actions
name: Build CasaOS
on:
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
#on:
# push:
# branches:
# - 'main'
# tags:
# - 'v*'
env:
REPO_URL: https://github.com/IceWhaleTech/CasaOS.git
REPO_BRANCH: main
PACK_SH_URL: https://raw.githubusercontent.com/jerrykuku/actions-casa/main/pack.sh
PACK_SH: pack.sh
TZ: Asia/Shanghai
jobs:
xgo:
strategy:
fail-fast: false
matrix:
go_version:
- 1.17.1
runs-on: ubuntu-latest
steps:
# - name: Get release
# id: get_release
# uses: bruceadams/get-release@v1.2.3
# env:
# GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
# - name: Initialization environment
# env:
# DEBIAN_FRONTEND: noninteractive
# run: |
# sudo timedatectl set-timezone "$TZ"
# sudo mkdir -p /workdir
# sudo chown $USER:$GROUPS /workdir
# - name: Clone source code
# working-directory: /workdir
# run: |
# df -hT $PWD
# git clone $REPO_URL -b $REPO_BRANCH --recursive casa
# ln -sf /workdir/casa $GITHUB_WORKSPACE/casa
# ls
- name: Set environment for github-release
run: |
echo "VERSION=$(cat types/system.go | grep CURRENTVERSION | awk '$2 == "CURRENTVERSION"{print $4}' | sed 's/"//g')" >>$GITHUB_ENV
echo "BODY=$(cat types/system.go | grep BODY | awk -F= '{print $2}' | sed 's/"//g')" >>$GITHUB_ENV
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Build frontend with nodejs and yarn
run: |
cd UI
ls
yarn install
yarn build
- name: list work
run: pwd
- name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: v0.7.5
go_version: ${{ matrix.go_version }}
dest: build
prefix: casa
targets: linux/amd64,linux/arm64,linux/arm-7
v: true
x: false
race: false
ldflags: -s -w
buildmode: default
#
# - name: List Files
# run: |
# ls
# mkdir build
# ls
# echo "::set-output name=status::success"
- name: Pack builds
run: |
wget $PACK_SH_URL
chmod +x $PACK_SH
./$PACK_SH
echo "::set-output name=status::success"
- name: list work
run: ls
- name: Update release
uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: >
linux-amd64-casaos.tar.gz
linux-arm64-casaos.tar.gz
linux-arm-7-casaos.tar.gz
tag: v${{ env.VERSION }}
body: >
${{ env.BODY }}
name: v${{ env.VERSION }}
gzip: false
allow_override: false
prerelease: true
# - name: Upload linux-amd64-casaos.tar.gz
# id: upload_assets_amd64
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: /workdir/casa/upload/linux-amd64-casaos.tar.gz
#
# - name: Upload linux-arm64-casaos.tar.gz
# id: upload_assets_arm64
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: /workdir/casa/upload/linux-arm64-casaos.tar.gz