forked from vosen/ZLUDA
-
Notifications
You must be signed in to change notification settings - Fork 41
121 lines (115 loc) · 3.76 KB
/
rust.yml
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
name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
if: false
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: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: linux.${{ github.sha }}
release_name: Generated release
body: |
This release is automatically generated by GitHub Actions and not tested.
draft: false
prerelease: true
- name: Upload Linux artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_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:
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: |
echo $Env:PATH
echo $Env:HIP_PATH
cargo xtask --release
- name: Prepare for release
run: |
cd ./target/release
7z ZLUDA-windows-amd64.zip *.dll
- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: windows.${{ github.sha }}
release_name: Generated release
body: |
This release is automatically generated by GitHub Actions and not tested.
draft: false
prerelease: true
- name: Upload Windows artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/ZLUDA-windows-amd64.zip
asset_name: ZLUDA-windows-amd64.zip
asset_content_type: application/zip