add cuda toolkit #62
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: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
free-disk-space: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
include: | |
- os: windows-latest | |
python-version: "3.12.4" | |
build-script: build.py | |
asset-content-type: application/x-7z-compressed | |
asset-extension: .7z | |
asset-suffix: "_FULL_Windows" | |
- os: windows-latest | |
python-version: "3.12.4" | |
build-script: build.py | |
asset-content-type: application/x-7z-compressed | |
asset-extension: .7z | |
asset-suffix: "_Lite_Windows" | |
- os: ubuntu-latest | |
python-version: "3.12.4" | |
build-script: build-linux.py | |
asset-content-type: application/gzip | |
asset-extension: .tar.gz | |
asset-suffix: "_FULL_Linux" | |
fail-fast: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install CUDA Toolkit (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
uses: Jimver/[email protected] | |
id: cuda-toolkit | |
with: | |
cuda: '12.4.0' | |
- name: Verify CUDA Installation (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo "Installed cuda version is: ${{ steps.cuda-toolkit.outputs.cuda }}" | |
echo "Cuda install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" | |
nvcc -V | |
- name: Sanity Check - List pip modules | |
run: python -m pip list | |
- name: Run build script | |
run: python ${{ matrix.build-script }} --venv | |
- name: Get the date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TAS }} | |
with: | |
tag_name: TAS_${{ steps.date.outputs.date }} | |
release_name: TAS_${{ steps.date.outputs.date }} | |
draft: true | |
- name: Compress main directory | |
shell: bash | |
run: | | |
cd "/d/a/TheAnimeScripter/TheAnimeScripter/dist/main/" | |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m ../../TAS_${{ steps.date.outputs.date }}${{ matrix.asset-suffix }}${{ matrix.asset-extension }} * | |
else | |
tar -czvf ../../TAS_${{ steps.date.outputs.date }}${{ matrix.asset-suffix }}${{ matrix.asset-extension }} * | |
fi | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TAS }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: TAS_${{ steps.date.outputs.date }}${{ matrix.asset-suffix }}${{ matrix.asset-extension }} | |
asset_name: TAS_${{ steps.date.outputs.date }}${{ matrix.asset-suffix }}${{ matrix.asset-extension }} | |
asset_content_type: ${{ matrix.asset-content-type }} |