Skip to content

Commit

Permalink
[ci] build CRAN R-package on Azure with every commit and attach it to…
Browse files Browse the repository at this point in the history
… releases (#4117)

* build CRAN R-package on Azure with every commit and attach to releases

* test CI

* fix path

* revert CI test
  • Loading branch information
StrikerRUS authored Mar 27, 2021
1 parent fe1b80a commit 69779e6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 72 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/r_artifacts.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/triggering_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ jobs:
"${{ github.event.comment.id }}" \
"gha_run_r_valgrind"
- name: Trigger R artifact builds
if: github.event.comment.body == '/gha run build-r-artifacts'
run: |
$GITHUB_WORKSPACE/.ci/trigger_dispatch_run.sh \
"${{ github.event.issue.pull_request.url }}" \
"${{ github.event.comment.id }}" \
"gha_run_build_r_artifacts"
- name: Trigger R Solaris CRAN checks
if: github.event.comment.body == '/gha run r-solaris'
run: |
Expand Down
33 changes: 31 additions & 2 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ resources:
- container: ubuntu-latest
image: 'ubuntu:latest'
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
- container: rbase
image: rocker/r-base
jobs:
###########################################
- job: Linux
Expand Down Expand Up @@ -200,7 +202,7 @@ jobs:
artifactName: PackageAssets
artifactType: container
###########################################
- job: MacOS
- job: macOS
###########################################
variables:
COMPILER: clang
Expand Down Expand Up @@ -274,6 +276,25 @@ jobs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
artifactType: container
###########################################
- job: R_artifact
###########################################
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
pool:
vmImage: 'ubuntu-latest'
container: rbase
steps:
- script: |
LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g")
sh build-cran-package.sh || exit -1
mv lightgbm_${LGB_VER}.tar.gz $(Build.ArtifactStagingDirectory)/lightgbm-${LGB_VER}-r-cran.tar.gz
displayName: 'Build CRAN R-package'
- task: PublishBuildArtifacts@1
condition: succeeded()
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: R-package
artifactType: container

###########################################
- job: Package
Expand All @@ -282,8 +303,9 @@ jobs:
- Linux
- Linux_latest
- QEMU_multiarch
- MacOS
- macOS
- Windows
- R_artifact
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
pool:
vmImage: 'ubuntu-latest'
Expand Down Expand Up @@ -314,6 +336,12 @@ jobs:
inputs:
artifactName: PackageAssets
downloadPath: $(Build.SourcesDirectory)/binaries
- task: DownloadBuildArtifacts@0
displayName: Download R-package
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
artifactName: R-package
downloadPath: $(Build.SourcesDirectory)/R
- script: |
python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets"
displayName: 'Create NuGet configuration files'
Expand All @@ -339,6 +367,7 @@ jobs:
title: '$(Build.SourceBranchName)'
assets: |
$(Build.SourcesDirectory)/binaries/PackageAssets/*
$(Build.SourcesDirectory)/R/R-package/*
$(Build.ArtifactStagingDirectory)/nuget/*.nupkg
$(Build.ArtifactStagingDirectory)/archives/*
assetUploadMode: 'delete'
Expand Down
6 changes: 1 addition & 5 deletions R-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,7 @@ sh build-cran-package.sh

This will create a file `lightgbm_${VERSION}.tar.gz`, where `VERSION` is the version of `LightGBM`.

Alternatively, GitHub Actions can generate this file for you. On a pull request, create a comment with this phrase:

> /gha run build-r-artifacts
Go to https://github.com/microsoft/LightGBM/actions, and find the most recent run of the "R artifact builds" workflow. If it ran successfully, you'll find a download link for the package (in `.zip` format) in that run's "Artifacts" section.
Also, CRAN package is generated with every commit to any repo's branch and can be found in "Artifacts" section of the associated Azure Pipelines run.

### Standard Installation from CRAN Package

Expand Down

0 comments on commit 69779e6

Please sign in to comment.