job deps #35
This file contains 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: Rust | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
repository-projects: write | |
steps: | |
- name: Create Release | |
uses: actions/create-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: rel.${{ github.sha }} | |
release_name: Generated release | |
body: | | |
This release is automatically generated by GitHub Actions. | |
draft: false | |
prerelease: true | |
build-linux: | |
needs: release | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
pull-requests: write | |
repository-projects: write | |
steps: | |
- name: Prepare for build | |
run: | | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Initialize submodule | |
run: | | |
git submodule init | |
git submodule update | |
- name: Prepare AMD HIP SDK | |
run: | | |
sudo apt update | |
wget https://repo.radeon.com/amdgpu-install/5.7.1/ubuntu/jammy/amdgpu-install_5.7.50701-1_all.deb | |
sudo apt install ./amdgpu-install_5.7.50701-1_all.deb | |
sudo apt update | |
- name: Install AMD HIP SDK | |
# can fail at dkms. ignore and continue | |
continue-on-error: true | |
run: sudo amdgpu-install --usecase=rocm,hip,hiplibsdk | |
- name: Build for Linux | |
run: | | |
cargo xtask --release | |
- name: Prepare for release | |
run: | | |
cd ./target/release | |
tar -czvf ZLUDA-linux-amd64.tar.gz *.so* | |
- name: Upload Linux artifact | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./target/release/ZLUDA-linux-amd64.tar.gz | |
asset_name: ZLUDA-linux-amd64.tar.gz | |
asset_content_type: application/gzip | |
build-windows: | |
needs: release | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
repository-projects: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Initialize submodule | |
run: | | |
git submodule init | |
git submodule update | |
- name: Install AMD HIP SDK | |
run: | | |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-23.Q4-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe" | |
.\amdgpu-install.exe -Install -View:1 | |
Start-Sleep -Seconds 60 | |
$setupId = (Get-Process ATISetup).id | |
Wait-Process -Id $setupId | |
- name: Build for Windows | |
run: | | |
$ROCm_PATH = "C:\Program Files\AMD\ROCm" | |
$Env:HIP_PATH = "$ROCm_PATH\$(Get-ChildItem -Path $ROCm_PATH -Name)" | |
$Env:PATH = "$Env:HIP_PATH\bin;$Env:PATH" | |
$Env:HIP_PATH = "$Env:HIP_PATH\" | |
cargo xtask --release | |
- name: Prepare for release | |
run: | | |
cd .\target\release | |
7z a .\ZLUDA-windows-amd64.zip .\*.dll | |
- name: Upload Windows artifact | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./target/release/ZLUDA-windows-amd64.zip | |
asset_name: ZLUDA-windows-amd64.zip | |
asset_content_type: application/zip |