Skip to content

Packaging

Packaging #323

Workflow file for this run

name: Packaging
on:
workflow_dispatch:
push:
branches:
- main
- cran/*
- packaging2
schedule:
- cron: "0 2 * * *"
jobs:
binaries:
runs-on: ${{ matrix.config.runner }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
config:
- {r_version: 'release', os: macOS, version: cpu-intel, runner: macOS-latest}
- {r_version: '', os: macOS, version: cpu-m1, runner: [self-hosted, m1]}
- {r_version: 'release', os: ubuntu, version: cpu, runner: [self-hosted, gce, disk]}
- {r_version: 'release', os: ubuntu, version: cu117, runner: [self-hosted, gce, disk]}
- {r_version: 'release', os: ubuntu, version: cu116, runner: [self-hosted, gce, disk]}
- {r_version: 'release', os: windows, version: cpu, runner: windows-2019}
- {r_version: 'release', os: windows, version: cu117, runner: windows-2019}
include:
- config: {version: cu117}
cuda: 11.7
cuda_patch: 0
- config: {version: cu116}
cuda: 11.6
cuda_patch: 1
- config: {os: ubuntu}
container: ubuntu:18.04
type: 'source'
r_install_tar: "tar"
- config: {os: windows}
type: 'win.binary'
r_install_tar: ""
- config: {os: macOS}
type: 'mac.binary'
r_install_tar: ""
env:
CUDA: ${{ matrix.cuda }}
CMAKE_FLAGS: "-DBUNDLE_DEPENDENCIES=ON"
BUILD_LANTERN: 1
DEBIAN_FRONTEND: noninteractive
R_INSTALL_TAR: ${{ matrix.r_install_tar }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-r
with:
r_version: ${{ matrix.config.r_version}}
makevars: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: "3.25.1"
- name: Install CUDA
if: ${{matrix.cuda != ''}}
uses: Jimver/cuda-toolkit@v0.2.8
id: cuda-toolkit
with:
cuda: "${{matrix.cuda}}.${{matrix.cuda_patch}}"
- name: Install CuDNN
if: ${{ matrix.cuda != '' }}
uses: ./.github/actions/install-cudnn
with:
cuda_version: ${{ matrix.cuda }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: false
extra-packages: any::rcmdcheck
needs: check
- name: Build binary package
id: build
run: |
dest_path <- contrib.url("../binaries", type="binary")
dir.create(dest_path, recursive = TRUE)
binary_path <- pkgbuild::build(binary = TRUE, dest_path=dest_path)
tools::write_PACKAGES(dest_path, type = "${{ matrix.type }}", addFiles = TRUE)
cat("pkg_version=", desc::desc_get("Version"), "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep="")
shell: Rscript {0}
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GCP_APPLICATION_CREDENTIALS }}
- id: 'upload-file'
uses: 'google-github-actions/upload-cloud-storage@v1'
with:
path: "../binaries"
destination: 'torch-lantern-builds/packages/${{ matrix.config.version }}/${{ steps.build.outputs.pkg_version }}/'
parent: false