-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] automate building CRAN package #3497
Conversation
jobs: | ||
cran-package: | ||
name: cran-package | ||
if: github.event.comment.body == '/gha build r-artifacts' && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/gha build r-artifacts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this created this job: https://github.com/microsoft/LightGBM/actions/runs/332889387
which failed like this:
No files were found with the provided path: /__w/LightGBM/LightGBM/lightgbm-3.0.0.99-r-cran.tar.gz\n. No artifacts will be uploaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/gha build-r-artifacts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/gha build r-artifacts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this kicked off https://github.com/microsoft/LightGBM/actions/runs/332893223
which produced one artifact
this creates a zip of the file, which is a little annoying, and it looks like you can't get around that (https://github.com/actions/upload-artifact#zipped-artifact-downloads):
when a workflow run finishes and an artifact is downloaded from either the UI or through the download api, a zip is dynamically created with all the file contents that were uploaded. There is currently no way to download artifacts after a workflow run finishes in a format other than a zip or to download artifact contents individually
But I don't think it's too bad. So for releases, the workflow would be:
- comment with
/gha build r-artifacts
- go to https://github.com/microsoft/LightGBM/actions, then to the artifacts action
- once it's done running, download the .zip
- unzip it, to get the artifact
- manually upload artifacts to the release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I think this is ready for review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be documented in https://github.com/microsoft/LightGBM/blob/master/R-package/README.md#preparing-a-cran-package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good idea. Added in bd895bf
Awesome!
If I'm not mistaken, we discussed that binaries should be taken from CRAN release and added to GitHub release, right? Pre-built binaries are needed only temporary for the time we are not accepted at CRAN. |
oh right! Yes you are totally correct, I forgot about that. Excellent 😎 |
I think the
|
@jameslamb Looks like the whole authors' section on that site (https://www.mcs.anl.gov/~thakur/) is down. So I think we can wait a little bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for now, thanks! But I think that in the (hopefully near) future we will need R package build jobs only for new releases and it will be possible to prepare artifacts at Azure Pipelines without any manual triggers but on v*
tag pushes. Just like NuGet artifact in a separate step and as GitHubRelease@0
task with certain conditions:
Lines 159 to 171 in 5cc9e67
- task: NuGetCommand@2 | |
inputs: | |
command: pack | |
packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' | |
packDestination: '$(Build.ArtifactStagingDirectory)' | |
- task: PublishBuildArtifacts@1 | |
inputs: | |
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | |
artifactName: NuGet | |
artifactType: container | |
- task: GitHubRelease@0 | |
displayName: 'Create GitHub Release' | |
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) |
Co-authored-by: Nikita Titov <[email protected]>
this is back now! Glad it was just something temporary. |
Sure! I think that for now the comment-triggered thing is better, since we might have to iterate multiple times on the same release to get to CRAN (like we did with #3338 ). Since this job is a small handful of shell commands in a container, I think it will be easy enough to run in Azure DevOps if/when we decide that that artifacts job is a better place for this to run. |
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Opening this PR, from a LightGBM branch, to test a GitHub Actions job that can be used to automatically build the CRAN package.
A step towards #3283
I'm not planning to do the package binaries...that can come in a separate PR.
If this works, it would allow any maintainer to build the CRAN package from a pull request, without needing their own local R environment.