forked from xmrig/xmrig
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
84 lines (81 loc) · 2.7 KB
/
.gitlab-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
stages:
- build
- publish
pack-win:
stage: build
variables:
GOOGLE_APPLICATION_CREDENTIALS: 'C:\Users\Builder\build-credentials.json'
tags:
- shell
- build
- win
script:
- mkdir build-win
- cd build-win
- cmake .. -G "Visual Studio 16 2019" -T v142,host=x64 -DXMRIG_DEPS=$PWD/../win-deps/msvc2019/x64
- cmake --build . --config Release
artifacts:
paths:
- build-win/Release/xmrig.exe
pack-linux:
stage: build
image: ubuntu:20.04
tags:
- docker
- build
- linux
before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -y git build-essential cmake wget lsb-core
script:
- cd scripts && ./build_deps.sh && cd ..
- mkdir build-linux && cd build-linux
- cmake .. -DXMRIG_DEPS=$PWD/../scripts/deps
- make
artifacts:
paths:
- build-linux/xmrig
upload:
stage: publish
image:
name: gcr.io/cloud-builders/gsutil
entrypoint:
- ''
only:
refs:
- tags
variables:
GOOGLE_APPLICATION_CREDENTIALS: /build-credentials.json
dependencies:
- pack-win
- pack-linux
tags:
- docker
- build
- linux
before_script:
- apt-get update
- apt-get install -y apt-transport-https
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
- apt-get install -y yarn nodejs
- echo $GCLOUD_BUILD_CREDENTIALS | base64 -d > /build-credentials.json
- gcloud auth activate-service-account --key-file /build-credentials.json
- yarn --ignore-scripts
script:
- yarn --cwd addon
- yarn --cwd addon build
- "VERSION=$(grep -m1 version package.json | awk -F: '{ print $2 }' | sed 's/[\", ]//g')"
- node scripts/sign.js build-win/Release/xmrig.exe
- cp addon/dist/bundle.js build-win/Release
- cp bin/WinRing0/WinRing0x64.sys build-win/Release
- cp addon/dist/bundle.js build-linux
- cp addon/package.json build-win/Release
- cp addon/package.json build-linux
- tar -czvf win-$VERSION.tar.gz -C build-win/Release package.json bundle.js xmrig.exe WinRing0x64.sys
- tar -czvf linux-$VERSION.tar.gz -C build-linux package.json bundle.js xmrig
- gsutil cp win-$VERSION.tar.gz gs://cudo-download/images/cudo-xmrig/win/x64/$VERSION.tar.gz
- gsutil cp linux-$VERSION.tar.gz gs://cudo-download/images/cudo-xmrig/linux/x64/$VERSION.tar.gz
- gsutil -m setmeta -h 'Cache-Control:no-cache' gs://cudo-download/images/cudo-xmrig/win/x64/$VERSION.tar.gz
- gsutil -m setmeta -h 'Cache-Control:no-cache' gs://cudo-download/images/cudo-xmrig/linux/x64/$VERSION.tar.gz