|
10 | 10 | - name: Checkout sources |
11 | 11 | uses: actions/checkout@v3 |
12 | 12 |
|
13 | | - - name: Install protoc |
14 | | - run: sudo apt install -y protobuf-compiler |
| 13 | + - name: Install Protoc |
| 14 | + uses: arduino/setup-protoc@v1 |
| 15 | + with: |
| 16 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
15 | 17 |
|
16 | 18 | - name: Install stable toolchain |
17 | 19 | uses: dtolnay/rust-toolchain@stable |
@@ -39,15 +41,55 @@ jobs: |
39 | 41 | # matrix: |
40 | 42 | # os: [ ubuntu-latest, macos-latest, windows-latest ] |
41 | 43 | steps: |
| 44 | + # Clean unnecessary files to save disk space |
| 45 | + - name: clean unnecessary files to save space |
| 46 | + run: | |
| 47 | + docker rmi `docker images -q` |
| 48 | + sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d |
| 49 | + sudo apt -y autoremove --purge |
| 50 | + sudo apt -y autoclean |
| 51 | + sudo apt clean |
| 52 | + rm --recursive --force "$AGENT_TOOLSDIRECTORY" |
| 53 | + df -h |
| 54 | +
|
| 55 | + # remove large packages manually (all but llvm) |
| 56 | + sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." |
| 57 | + sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." |
| 58 | + sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." |
| 59 | + sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." |
| 60 | + sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." |
| 61 | + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." |
| 62 | + sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." |
| 63 | + sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." |
| 64 | + sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." |
| 65 | + sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." |
| 66 | + df -h |
| 67 | +
|
| 68 | + # Free up disk space on Ubuntu |
| 69 | + - name: Free Disk Space (Ubuntu) |
| 70 | + uses: jlumbroso/free-disk-space@main |
| 71 | + with: |
| 72 | + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB |
| 73 | + tool-cache: false |
| 74 | + |
| 75 | + # large packages, except llvm, are removed manually during the previous step |
| 76 | + # see: https://github.com/jlumbroso/free-disk-space/issues/6 |
| 77 | + # TODO: use the discussed whitelist feature when available |
| 78 | + large-packages: false |
| 79 | + |
| 80 | + swap-storage: true |
| 81 | + |
42 | 82 | - name: Checkout sources |
43 | 83 | uses: actions/checkout@v3 |
44 | 84 |
|
45 | 85 | - name: Fix CRLF on Windows |
46 | 86 | if: runner.os == 'Windows' |
47 | 87 | run: git config --global core.autocrlf false |
48 | 88 |
|
49 | | - - name: Install protoc |
50 | | - run: sudo apt install -y protobuf-compiler |
| 89 | + - name: Install Protoc |
| 90 | + uses: arduino/setup-protoc@v1 |
| 91 | + with: |
| 92 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
51 | 93 |
|
52 | 94 | - name: Install stable toolchain |
53 | 95 | uses: dtolnay/rust-toolchain@stable |
@@ -129,8 +171,10 @@ jobs: |
129 | 171 | - name: Checkout sources |
130 | 172 | uses: actions/checkout@v3 |
131 | 173 |
|
132 | | - - name: Install protoc |
133 | | - run: sudo apt install -y protobuf-compiler |
| 174 | + - name: Install Protoc |
| 175 | + uses: arduino/setup-protoc@v1 |
| 176 | + with: |
| 177 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
134 | 178 |
|
135 | 179 | - name: Install stable toolchain |
136 | 180 | uses: dtolnay/rust-toolchain@stable |
@@ -162,10 +206,10 @@ jobs: |
162 | 206 | - name: Checkout sources |
163 | 207 | uses: actions/checkout@v3 |
164 | 208 |
|
165 | | - - name: Install protoc |
166 | | - run: | |
167 | | - sudo apt update -y |
168 | | - sudo apt install -y protobuf-compiler |
| 209 | + - name: Install Protoc |
| 210 | + uses: arduino/setup-protoc@v1 |
| 211 | + with: |
| 212 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
169 | 213 |
|
170 | 214 | - name: Install llvm |
171 | 215 | id: install_llvm |
@@ -223,10 +267,10 @@ jobs: |
223 | 267 | - name: Checkout sources |
224 | 268 | uses: actions/checkout@v3 |
225 | 269 |
|
226 | | - - name: Install protoc |
227 | | - run: | |
228 | | - sudo apt update -y |
229 | | - sudo apt install -y protobuf-compiler |
| 270 | + - name: Install Protoc |
| 271 | + uses: arduino/setup-protoc@v1 |
| 272 | + with: |
| 273 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
230 | 274 |
|
231 | 275 | - name: Install llvm |
232 | 276 | id: install_llvm |
@@ -271,3 +315,40 @@ jobs: |
271 | 315 |
|
272 | 316 | - name: Build wasm pack for nodejs |
273 | 317 | run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full |
| 318 | + |
| 319 | + build-release: |
| 320 | + name: Build Ubuntu Release |
| 321 | + runs-on: ubuntu-latest |
| 322 | + steps: |
| 323 | + - name: Checkout sources |
| 324 | + uses: actions/checkout@v3 |
| 325 | + |
| 326 | + - name: Install Protoc |
| 327 | + uses: arduino/setup-protoc@v1 |
| 328 | + with: |
| 329 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 330 | + |
| 331 | + - name: Install stable toolchain |
| 332 | + uses: dtolnay/rust-toolchain@stable |
| 333 | + |
| 334 | + - name: Cache |
| 335 | + uses: actions/cache@v3 |
| 336 | + with: |
| 337 | + path: | |
| 338 | + ~/.cargo/bin/ |
| 339 | + ~/.cargo/registry/index/ |
| 340 | + ~/.cargo/registry/cache/ |
| 341 | + ~/.cargo/git/db/ |
| 342 | + target/ |
| 343 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 344 | + |
| 345 | + - name: Install zig |
| 346 | + if: runner.os == 'Linux' |
| 347 | + uses: goto-bus-stop/setup-zig@v2 # needed for cargo-zigbuild |
| 348 | + |
| 349 | + - name: Build on Linux |
| 350 | + if: runner.os == 'Linux' |
| 351 | + # We're using musl to make the binaries statically linked and portable |
| 352 | + run: | |
| 353 | + cargo install cargo-zigbuild |
| 354 | + cargo --verbose zigbuild --bin kaspad --bin simpa --bin rothschild --release --target x86_64-unknown-linux-gnu.2.27 # Use an older glibc version |
0 commit comments