fix: enforce NGC attestation delivery #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: QSDM Hive Linux | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "hive-v*" | |
| pull_request: | |
| paths: | |
| - "apps/qsdm-hive/qsdm-hive-main/**" | |
| - "apps/qsdm-edge-agent/**" | |
| - "QSDM/source/cmd/qsdm-edge-agent/**" | |
| - "QSDM/source/cmd/qsdmminer-console/**" | |
| - "QSDM/source/pkg/edgepool/**" | |
| - "QSDM/source/pkg/mining/**" | |
| - ".github/workflows/qsdm-hive-linux.yml" | |
| concurrency: | |
| group: qsdm-hive-linux-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| package-linux: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: QSDM/source/go.mod | |
| cache-dependency-path: QSDM/source/go.sum | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: | | |
| apps/qsdm-hive/qsdm-hive-main/package-lock.json | |
| apps/qsdm-hive/qsdm-hive-main/release/app/package-lock.json | |
| - name: Build native QSDM tools | |
| working-directory: QSDM/source | |
| env: | |
| CGO_ENABLED: "0" | |
| run: | | |
| mkdir -p ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64 | |
| go build -trimpath -ldflags "-s -w" -o ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdmcli ./cmd/qsdmcli | |
| EDGE_AGENT_VERSION="$(tr -d '[:space:]' < ../../apps/qsdm-edge-agent/VERSION)" | |
| go build -trimpath -ldflags "-s -w -X main.version=${EDGE_AGENT_VERSION}" -o ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-edge-agent ./cmd/qsdm-edge-agent | |
| go build -trimpath -ldflags "-s -w -X main.version=${EDGE_AGENT_VERSION}" -o ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-edge-control ./cmd/qsdm-edge-control | |
| HIVE_VERSION="$(node -p "require('../../apps/qsdm-hive/qsdm-hive-main/release/app/package.json').version")" | |
| BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" | |
| GIT_SHA="$(git rev-parse --short HEAD)" | |
| go build -trimpath -ldflags "-s -w -X github.com/blackbeardONE/QSDM/pkg/buildinfo.Version=hive-v${HIVE_VERSION} -X github.com/blackbeardONE/QSDM/pkg/buildinfo.GitSHA=${GIT_SHA} -X github.com/blackbeardONE/QSDM/pkg/buildinfo.BuildDate=${BUILD_DATE}" -o ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdmminer-console ./cmd/qsdmminer-console | |
| chmod 0755 ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdmcli | |
| chmod 0755 ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-edge-agent | |
| chmod 0755 ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-edge-control | |
| chmod 0755 ../../apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdmminer-console | |
| - name: Install CUDA compiler and build Linux GPU helper | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends nvidia-cuda-toolkit | |
| nvcc -O3 -std=c++17 -arch=sm_75 -ccbin g++-12 \ | |
| QSDM/source/cmd/qsdm-edge-gpu-helper/main.cu \ | |
| -o apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-edge-gpu-helper | |
| nvcc -O3 -std=c++17 -ccbin g++-12 \ | |
| -gencode arch=compute_75,code=sm_75 \ | |
| -gencode arch=compute_86,code=sm_86 \ | |
| -gencode arch=compute_89,code=sm_89 \ | |
| -gencode arch=compute_90,code=sm_90 \ | |
| QSDM/source/cmd/qsdm-miner-cuda-solver/main.cu \ | |
| -o apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-miner-cuda-solver | |
| chmod 0755 apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-edge-gpu-helper | |
| chmod 0755 apps/qsdm-hive/qsdm-hive-main/native/linux/x64/qsdm-miner-cuda-solver | |
| - name: Install Hive dependencies | |
| working-directory: apps/qsdm-hive/qsdm-hive-main | |
| run: | | |
| npm ci --ignore-scripts | |
| npm --prefix release/app ci --ignore-scripts | |
| npm exec electron-builder -- install-app-deps | |
| - name: Test Hive task integration | |
| working-directory: apps/qsdm-hive/qsdm-hive-main | |
| run: | | |
| npx tsc --noEmit | |
| npm test -- --runInBand src/main/services/qsdmSystemTasks.spec.ts src/main/services/qsdmTaskActions.spec.ts | |
| - name: Build Hive | |
| working-directory: apps/qsdm-hive/qsdm-hive-main | |
| run: npm run build | |
| - name: Package AppImage and tarball | |
| working-directory: apps/qsdm-hive/qsdm-hive-main | |
| run: npx electron-builder build --linux AppImage tar.gz --x64 --publish never --config.directories.output=release/build-linux | |
| - name: Verify native executables | |
| working-directory: apps/qsdm-hive/qsdm-hive-main | |
| run: | | |
| test -x release/build-linux/linux-unpacked/resources/native/qsdmcli | |
| test -x release/build-linux/linux-unpacked/resources/edge/qsdm-edge-agent | |
| test -x release/build-linux/linux-unpacked/resources/edge/qsdm-edge-control | |
| test -x release/build-linux/linux-unpacked/resources/edge/qsdm-edge-gpu-helper | |
| test -x release/build-linux/linux-unpacked/resources/miner/qsdmminer-console | |
| test -x release/build-linux/linux-unpacked/resources/miner/qsdm-miner-cuda-solver | |
| tar -tvf release/build-linux/qsdm-hive-*-linux-x64.tar.gz | grep -E -- '-rwxr-xr-x.*resources/(native/qsdmcli|edge/qsdm-edge-agent|edge/qsdm-edge-control|edge/qsdm-edge-gpu-helper|miner/qsdmminer-console|miner/qsdm-miner-cuda-solver)$' | |
| release/build-linux/linux-unpacked/resources/edge/qsdm-edge-agent version | |
| release/build-linux/linux-unpacked/resources/edge/qsdm-edge-control version | |
| release/build-linux/linux-unpacked/resources/miner/qsdmminer-console --version | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: qsdm-hive-linux-${{ github.sha }} | |
| path: | | |
| apps/qsdm-hive/qsdm-hive-main/release/build-linux/*.AppImage | |
| apps/qsdm-hive/qsdm-hive-main/release/build-linux/*.tar.gz | |
| apps/qsdm-hive/qsdm-hive-main/release/build-linux/*.yml | |
| if-no-files-found: error | |
| retention-days: 14 |