Skip to content

Commit

Permalink
Created a build script
Browse files Browse the repository at this point in the history
  • Loading branch information
tmrlvi committed Jan 16, 2022
1 parent 4a93427 commit c164c34
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Fix LibOpenCL on Linux
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ocl-icd-opencl-dev -y
- name: Fix CRLF on Windows
if: runner.os == 'Windows'
run: git config --global core.autocrlf false
Expand Down Expand Up @@ -126,6 +132,12 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Fix LibOpenCL on Linux
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ocl-icd-opencl-dev -y
- name: Fix CRLF on Windows
if: runner.os == 'Windows'
run: git config --global core.autocrlf false
Expand Down
55 changes: 54 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ocl-icd-opencl-dev
sudo apt install ocl-icd-opencl-dev -y
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -92,3 +92,56 @@ jobs:
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: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install CUDA Linux
if: runner.os == 'Linux'
uses: tmrlvi/cuda-toolkit@master
with:
cuda: '11.2.2'

- 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 ${asset_name}
mv ./target/x86_64-unknown-linux-gnu/release/kaspa-miner ${asset_name}/${binary_name}
mv ./target/x86_64-unknown-linux-gnu/release/libkaspa*.so ${asset_name}/
bash integrations/${{ matrix.itegration }}/build.sh "${{ github.event.release.tag_name }}" "${binary_name}" "${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
4 changes: 4 additions & 0 deletions integrations/hiveos/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
integrations/hiveos/createmanifest.sh $1 $2
mkdir $3
cp h-manifest.conf integrations/hiveos/*.sh $2/* $3
tar czvf $3.tgz $3

0 comments on commit c164c34

Please sign in to comment.