zeratax / yacx

Yet Another CudaExecutor - wrapper to easily compile and execute cuda kernels
https://zeratax.github.io/yacx
MIT License
8 stars 4 forks source link

github release for windows #169

Open zeratax opened 4 years ago

zeratax commented 4 years ago

would maybe be neat to add to the release workflow a windows build when #167 is merged.

Now cuda does not support docker under windows so I'm not sure how well this would work out with caching those gigantic dependencies or if the action would timeout. https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#is-microsoft-windows-supported

I assume it would look like:

jobs:
  build_ubuntu:
    runs-on: ubuntu-18.04
    container: nvidia/cuda:10.2-devel-ubuntu18.04
    steps:
      - name: Checkout
        uses: actions/checkout@v1
        with:
         submodules: recursive
      - uses: olegtarasov/get-tag@v2
        id: tagName
      - name: Announce version
        run: echo "creating library for ${GIT_TAG_NAME}"
      - name: Install deps
        run: |
          apt-get update -y
          apt-get update
          apt-get install cmake openjdk-11-jdk default-jdk -y
          export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
      - name: Build project
        run: |
          cmake -H. -Bbuild
          make -C build yacx
          make -C build yacx-jni
          export unix_dir=yacx-v${GIT_TAG_NAME}_unix/
          mkdir -p dist/$unix_dir/java/bin/
          cp build/libyacx.so dist/$unix_dir
          cp build/libyacx-jni.so dist/$unix_dir
          cp -R build/java/bin/yacx/ dist/$unix_dir/java/bin/
      - name: Upload release artifacts
        uses: fnkr/github-action-ghr@v1
        env:
          GHR_COMPRESS: xz
          GHR_PATH: dist/
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   build_windows:
    runs-on: windows-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
        with:
         submodules: recursive
      - uses: olegtarasov/get-tag@v2
        id: tagName
      - name: Announce version
        run: echo "creating library for ${GIT_TAG_NAME}"
      - name: Install deps
        run: |
          choco install ojdkbuild
          choco install cuda
          choco install sbt
      - name: Build project
        run: |
          cmake -H. -Bbuild --build
          set win64_dir=yacx-v${GIT_TAG_NAME}_unix\
          md dist\$unix_dir\java\bin\
          xcopy "build\libyacx.so" "dist\%win64_dir%"
          xcopy "build\libyacx-jni.so" "dist\%win64_dir%"
          xcopy "build\java\bin\yacx\" "dist\%win64_dir%\java\bin\" /s /e
      - name: Upload release artifacts
        uses: fnkr/github-action-ghr@v1
        env:
          GHR_COMPRESS: xz
          GHR_PATH: dist/
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I'm not really well versed in batch scripting or w/e this is. Also really wonder if all the duplicate stuff, e.g. copying and uploading the release could be avoided by using https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#passing-data-between-jobs-in-a-workflow