forked from tmrlvi/kaspa-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (145 loc) · 6 KB
/
deploy.yaml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Build and upload assets
on:
release:
types: [ published ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Build gnu-linux on ubuntu-18.04 and musl on ubuntu latest
os: [ ubuntu-18.04, windows-latest, macos-latest ]
features: ["default", "kaspacuda/overclock "]
name: Building, ${{ matrix.os }} ${{ matrix.features }}
steps:
- name: Fix CRLF on Windows
if: runner.os == 'Windows'
run: git config --global core.autocrlf false
- name: Fix LibOpenCL on Linux
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ocl-icd-opencl-dev -y
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install CUDA Linux
if: runner.os == 'Linux'
uses: Jimver/[email protected]
with:
cuda: '11.2.2'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
- name: Install CUDA Windows
if: runner.os == 'Windows'
uses: Jimver/[email protected]
with:
cuda: '11.5.1'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
- name: Build on Linux GNU
if: matrix.os == 'ubuntu-18.04'
# We're using musl to make the binaries statically linked and portable
run: |
cargo build --target=x86_64-unknown-linux-gnu --release --all --features ${{ matrix.features }}
feature_name=${{ matrix.features }}
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-${feature_name/\//-}-linux-gnu-amd64"
strip ./target/x86_64-unknown-linux-gnu/release/kaspa-miner
mkdir ${asset_name}
mv ./target/x86_64-unknown-linux-gnu/release/kaspa-miner ${asset_name}/${asset_name}
mv ./target/x86_64-unknown-linux-gnu/release/libkaspa*.so ${asset_name}/
tar czvf ${asset_name}.tgz ${asset_name}
echo "archive=${asset_name}.tgz" >> $GITHUB_ENV
echo "asset_name=${asset_name}.tgz" >> $GITHUB_ENV
- name: Build on Windows
if: matrix.os == 'windows-latest'
shell: bash
run: |
cargo build --target=x86_64-pc-windows-msvc --release --all --features ${{ matrix.features }}
feature_name=${{ matrix.features }}
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-${feature_name/\//-}-win64-amd64"
mkdir ${asset_name}
mv ./target/x86_64-pc-windows-msvc/release/kaspa-miner.exe ${asset_name}/${asset_name}.exe
mv ./target/x86_64-pc-windows-msvc/release/kaspa*.dll ${asset_name}/
bash ./integrations/windows/create_bat.sh ${asset_name}
7z a -tzip -r ${asset_name}.zip ${asset_name}
echo "archive=${asset_name}.zip" >> $GITHUB_ENV
echo "asset_name=${asset_name}.zip" >> $GITHUB_ENV
- name: Build on MacOS
if: matrix.os == 'macos-latest'
run: |
cargo build --target=x86_64-apple-darwin --release -p kaspa-miner
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-cpu-only-osx-amd64"
mkdir ${asset_name}
mv ./target/x86_64-apple-darwin/release/kaspa-miner ${asset_name}/${asset_name}
tar czvf ${asset_name}.tgz ${asset_name}
echo "archive=${asset_name}.tgz" >> $GITHUB_ENV
echo "asset_name=${asset_name}.tgz" >> $GITHUB_ENV
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "./${{ env.archive }}"
asset_name: "${{ env.asset_name }}"
asset_content_type: application/zip
intergrations:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
# Build gnu-linux on ubuntu-18.04 and musl on ubuntu latest
itegration: [ hiveos ]
name: Integrating, ${{ matrix.itegration }}
steps:
- name: Fix LibOpenCL on Linux
run: |
sudo apt update
sudo apt install ocl-icd-opencl-dev -y
- name: Check out code into the module directory
uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install CUDA Linux
if: runner.os == 'Linux'
uses: Jimver/[email protected]
with:
cuda: '11.2.2'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
- name: Build ${{ matrix.itegration }} Script
run: |
cargo build --target=x86_64-unknown-linux-gnu --release --all
binary_name="kaspa-miner-${{ github.event.release.tag_name }}-linux-gnu-amd64"
asset_name="kaspa-miner-${{ matrix.itegration }}"
strip ./target/x86_64-unknown-linux-gnu/release/kaspa-miner
mkdir kaspa-miner
mv ./target/x86_64-unknown-linux-gnu/release/kaspa-miner kaspa-miner/${binary_name}
mv ./target/x86_64-unknown-linux-gnu/release/libkaspa*.so kaspa-miner/
bash integrations/${{ matrix.itegration }}/build.sh "${{ github.event.release.tag_name }}" "${binary_name}" kaspa-miner
echo "archive=${asset_name}.tgz" >> $GITHUB_ENV
echo "asset_name=${asset_name}.tgz" >> $GITHUB_ENV
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "./${{ env.archive }}"
asset_name: "${{ env.asset_name }}"
asset_content_type: application/zip