forked from torch-js/torch-js
-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (76 loc) · 2.85 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
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
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Setup Conda to install cudnn on windows-latest
uses: s-weigand/setup-conda@v1
if: ${{ matrix.os == 'windows-latest' }}
with:
activate-conda: false
- name: Install CUDA on windows-latest
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
env:
cuda: "11.6.2"
cudnn: "8.4.0.27"
run: |
# Install CUDA via a powershell script
.\.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.6.2"
cudnn: "8.4.0.27"
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: Install packages
run: yarn upgrade --dev
- name: Prebuild
run: yarn build-prebuild
- name: Check prebuild bundle size
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
run: |
ls prebuilds/@arition
ls build/Release
- name: Publish prebuild
run: yarn build-prebuild -u ${{ secrets.GITHUB_TOKEN }}