-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.drone.yml
135 lines (128 loc) · 5.38 KB
/
.drone.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
kind: pipeline
type: docker
name: build-go-amd64
platform:
os: linux
arch: amd64
steps:
- name: prepare
image: techknowlogick/xgo:latest
volumes:
- name: cache
path: /release
commands:
- export PATH=$PATH:$GOPATH/bin
- export GO111MODULE=on
- go env
- "sed -i '157s/^[ \t]*//' /build.sh"
- "sed -i '153,156d;158d' /build.sh"
- go generate -mod=vendor ./...
- name: build-win-64
image: techknowlogick/xgo:latest
volumes:
- name: cache
path: /release
commands:
- export PATH=$PATH:$GOPATH/bin
- export GO111MODULE=on
- "sed -i '157s/^[ \t]*//' /build.sh"
- "sed -i '153,156d;158d' /build.sh"
- ln -s /drone/src /source
- rm -r include/* || true
- cd Release/; find . -print | sed -e 's/^/"/g' -e 's/$/"/g' | grep -v "\".\"" | grep -v "\"./icon.png\"" | grep -v "\"./.gitkeep\"" | xargs rm -rf; cd .. || true
- wget --no-verbose http://opensource.spotify.com/cefbuilds/cef_binary_83.3.11%2Bg1fac1e5%2Bchromium-83.0.4103.61_windows64_minimal.tar.bz2
- tar -xjf *.tar.bz2
- rm *.tar.bz2
- mv cef_*/include/* include/
- mv cef_*/Re*/* Release/
- rm -r cef_*/
- xgo -x -targets 'windows/amd64' -pkg 'examples/mainthread' -out cefgo .
- xgo -x -targets 'windows/amd64' -pkg 'examples/subprocess' -out helper .
- cp /build/* Release/
- ls -lah Release/
- cd Release/; zip -r /release/windows-amd64.zip *
- name: build-linux-64
image: techknowlogick/xgo:latest
volumes:
- name: cache
path: /release
commands:
- export PATH=$PATH:$GOPATH/bin
- export GO111MODULE=on
- "sed -i '157s/^[ \t]*//' /build.sh"
- "sed -i '153,156d;158d' /build.sh"
- apt-get update && apt-get install -y libgbm-dev libxss-dev
- ln -s /drone/src /source
- rm -r include/* || true
- cd Release/; find . -print | sed -e 's/^/"/g' -e 's/$/"/g' | grep -v "\".\"" | grep -v "\"./icon.png\"" | grep -v "\"./.gitkeep\"" | xargs rm -rf; cd .. || true
- wget --no-verbose http://opensource.spotify.com/cefbuilds/cef_binary_83.3.11%2Bg1fac1e5%2Bchromium-83.0.4103.61_linux64_minimal.tar.bz2
- tar -xjf *.tar.bz2
- rm *.tar.bz2
- mv cef_*/include/* include/
- mv cef_*/Re*/* Release/
- rm -r cef_*/
- xgo -x -targets 'linux/amd64' -pkg 'examples/mainthread' -out cefgo .
- xgo -x -targets 'linux/amd64' -pkg 'examples/subprocess' -out helper .
- cp /build/* Release/
- ls -lah Release/
- cd Release/; zip -r /release/linux-amd64.zip *
- name: build-linux-arm64
image: techknowlogick/xgo:latest
volumes:
- name: cache
path: /release
commands:
- export PATH=$PATH:$GOPATH/bin
- export GO111MODULE=on
- "sed -i '157s/^[ \t]*//' /build.sh"
- "sed -i '153,156d;158d' /build.sh"
- apt-get update
- dpkg --add-architecture arm64
- dpkg --print-foreign-architectures
- sed -i "s/^deb http/deb [arch=$(dpkg --print-architecture)] http/" /etc/apt/sources.list
- sed "s/CODENAME/$(sed 's/UBUNTU_CODENAME=//;t;d' /etc/os-release)/g" examples/arm64-ubuntu-sources >> /etc/apt/sources.list
- cat /etc/apt/sources.list
- apt-get update && apt-get install -y libgbm1:arm64 libxss1:arm64 libgtk2.0-0:arm64 libsm6:arm64 libnss3:arm64 libnspr4:arm64 libatk1.0-0:arm64 libatk-bridge2.0-0:arm64 libfontconfig1-dev:arm64 libxcomposite1:arm64 libxdamage1:arm64 libxfixes3:arm64 libglib2.0-dev:arm64 libxtst6:arm64 libxrandr2:arm64 libx11-xcb1:arm64 libxcb-dri3-0:arm64 libxcursor1:arm64 libxi6:arm64 libdbus-1-3:arm64 libasound2:arm64 libpangocairo-1.0-0:arm64 libpango-1.0-0:arm64 libcups2:arm64
- ln -s /drone/src /source
- rm -r include/* || true
- cd Release/; find . -print | sed -e 's/^/"/g' -e 's/$/"/g' | grep -v "\".\"" | grep -v "\"./icon.png\"" | grep -v "\"./.gitkeep\"" | xargs rm -rf; cd .. || true
- wget --no-verbose http://opensource.spotify.com/cefbuilds/cef_binary_83.3.11%2Bg1fac1e5%2Bchromium-83.0.4103.61_linuxarm64_minimal.tar.bz2
- tar -xjf *.tar.bz2
- rm *.tar.bz2
- mv cef_*/include/* include/
- mv cef_*/Re*/* Release/
- rm -r cef_*/
- xgo -x -targets 'linux/arm64' -pkg 'examples/mainthread' -out cefgo .
- xgo -x -targets 'linux/arm64' -pkg 'examples/subprocess' -out helper .
- cp /build/* Release/
- ls -lah Release/
- cd Release/; zip -r /release/linux-arm64.zip *
- name: artifacts
image: alpine:latest
volumes:
- name: cache
path: /release
commands:
- cat /etc/issue
- apk add --no-cache openssh-client ca-certificates sshpass
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- export REMOTE_PATH=/data/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BRANCH}/$(date +'%Y%m%d-%H%M%S')-${DRONE_COMMIT_SHA:0:9}/
- export SSHPASS=$${REMOTE_PASSWORD}
- sshpass -e ssh $${REMOTE_USERNAME}@$${REMOTE_HOST} "mkdir -p $REMOTE_PATH"
- "sshpass -e scp -r /release/* $${REMOTE_USERNAME}@$${REMOTE_HOST}:$REMOTE_PATH"
environment:
REMOTE_USERNAME:
from_secret: remote_username
REMOTE_PASSWORD:
from_secret: remote_password
REMOTE_HOST:
from_secret: remote_host
when:
event:
- push
- tag
volumes:
- name: cache
temp: {}