forked from arition/torch-js
-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (91 loc) · 3.68 KB
/
publish-prebuild.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
name: publish-prebuild
on:
push:
tags:
- "v*.*.*"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
if: "!contains(github.event.head_commit.message, 'publish-prebuild skip')"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout for non Windows machine
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/checkout@v2
- name: Checkout for Windows machine
if: ${{ matrix.os == 'windows-latest' }}
run: |
mkdir C:/torch-js
git clone https://github.com/Techainer/torch-js.git C:/torch-js
cd C:/torch-js
git checkout $($env:GITHUB_SHA)
# - name: Install CUDA on windows-latest
# if: ${{ matrix.os == 'windows-latest' }}
# working-directory: C:/torch-js
# shell: powershell
# env:
# cuda: "11.1.1"
# cudnn: "8.1.0.77"
# run: |
# # Install CUDA via a powershell script
# C:\torch-js\.github\workflows\scripts\install_cuda_windows.ps1
# if ($?) {
# # Set paths for subsequent steps, using $env:CUDA_PATH
# echo "Adding CUDA to CUDA_PATH, CUDA_PATH_X_Y and PATH"
# echo "CUDA_PATH=$($env:CUDA_PATH)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "$($env:CUDA_PATH_VX_Y)=$($env:CUDA_PATH)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "$($env:CUDA_PATH)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# }
- name: Install CUDA on ubuntu-latest
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
env:
cuda: "11.1"
cudnn: "8.0.5.39"
run: |
source ./.github/workflows/scripts/install_cuda_ubuntu.sh
if [[ $? -eq 0 ]]; then
# Set paths for subsequent steps, using ${CUDA_PATH}
echo "Adding CUDA to CUDA_PATH, PATH and LD_LIBRARY_PATH"
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
fi
- name: Free up 24GB of disk space
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo rm -rf /usr/share/dotnet
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '14'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install conda on Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: s-weigand/setup-conda@v1
- name: Install cmake dependency on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: conda install -y libpng jpeg
- name: Install packages Unix
if: ${{ matrix.os != 'windows-latest' }}
run: yarn upgrade --dev
- name: Prebuild Unix
if: ${{ matrix.os != 'windows-latest' }}
run: yarn build-prebuild -u ${{ secrets.ACCESS_GITHUB_TOKEN }}
- name: Install packages Windows
if: ${{ matrix.os == 'windows-latest' }}
working-directory: C:/torch-js
run: yarn upgrade --dev
- name: Prebuild Windows
if: ${{ matrix.os == 'windows-latest' }}
working-directory: C:/torch-js
run: yarn build-prebuild -u ${{ secrets.ACCESS_GITHUB_TOKEN }}