-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] automate building CRAN package (#3497)
* [ci] automate building CRAN package * add workflow for building CRAN package * remove newlines * add to R README * Apply suggestions from code review Co-authored-by: Nikita Titov <[email protected]> * add timeout Co-authored-by: Nikita Titov <[email protected]>
- Loading branch information
1 parent
0ab9f97
commit 88a7344
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: R artifact builds | ||
|
||
on: | ||
pull_request_review_comment: | ||
types: [created] | ||
|
||
jobs: | ||
cran-package: | ||
name: cran-package | ||
if: github.event.comment.body == '/gha build r-artifacts' && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association) | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
container: rocker/r-base | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 5 | ||
submodules: true | ||
- name: Build package | ||
shell: bash | ||
id: build_package | ||
run: | | ||
sh build-cran-package.sh || exit -1 | ||
LGB_VERSION=$(cat VERSION.txt | sed "s/rc/-/g") | ||
ARTIFACT_NAME=lightgbm-${LGB_VERSION}-r-cran.tar.gz | ||
mv lightgbm_${LGB_VERSION}.tar.gz ${ARTIFACT_NAME} | ||
echo "::set-output name=artifact_name::${ARTIFACT_NAME}" | ||
echo "::set-output name=artifact_path::$(pwd)/${ARTIFACT_NAME}" | ||
- name: Upload package | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.build_package.outputs.artifact_name }} | ||
path: ${{ steps.build_package.outputs.artifact_path }} |
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