nealrichardson commented on code in PR #13149: URL: https://github.com/apache/arrow/pull/13149#discussion_r882899948
########## .github/workflows/r_nightly.yml: ########## @@ -0,0 +1,124 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: Upload R Nightly builds + +on: + workflow_dispatch: + inputs: + prefix: + description: Job prefix to use. + required: false + default: '' + schedule: + #Crossbow packagin runs at 0 8 * * * + - cron: '0 14 * * *' + +jobs: + upload: + env: + PREFIX: ${{ github.event.inputs.prefix || ''}} + runs-on: ubuntu-latest + steps: + - name: Checkout Arrow + uses: actions/checkout@v3 + with: + fetch-depth: 1 + path: arrow + repository: apache/arrow + ref: master + submodules: recursive + - name: Checkout Crossbow + uses: actions/checkout@v3 + with: + fetch-depth: 0 + path: crossbow + repository: ursacomputing/crossbow + ref: master + - name: Set up Python + uses: actions/setup-python@v3 + with: + cache: 'pip' + python-version: 3.8 + - name: Install Archery + shell: bash + run: pip install -e arrow/dev/archery[all] + - run: mkdir -p binaries + - name: Download Artifacts + run: | + if [ -z $PREFIX ]; then + PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0 + fi + echo $PREFIX + + archery crossbow download-artifacts -f r-nightly-packages -t binaries --skip-pattern-validation $PREFIX + - name: Build Repository + shell: Rscript {0} + run: | + art_path <- list.files("binaries", + recursive = TRUE, + include.dirs = TRUE, + pattern = "r-nightly-packages$", + full.names = TRUE + ) + + pkgs <- list.files(art_path, pattern = "r-pkg_*") + src_i <- grep("r-pkg_src", pkgs) + src_pkg <- pkgs[src_i] + pkgs <- pkgs[-src_i] + libs <- list.files(art_path, pattern = "r-libarrow*") + + new_names <- sub("r-pkg_", "", pkgs, fixed = T) + matches <- regmatches(new_names, regexec("(([a-z]+)-[\\.a-zA-Z0-9]+)_(\\d\\.\\d)-(arrow.+)$", new_names)) + + dir.create("repo/src/contrib", recursive = TRUE) + file.copy(paste0(art_path, "/", src_pkg), paste0("repo/src/contrib/", sub("r-pkg_src-", "", src_pkg))) + tools::write_PACKAGES("repo/src/contrib", type = "source", verbose = TRUE) + + for (match in matches) { + path <- paste0("repo/bin/", match[[3]], "/contrib/", match[[4]]) + path <- sub("macos", "macosx", path) + dir.create(path, recursive = TRUE) + file <- list.files(art_path, pattern = paste0(match[[1]], "*"), full.names = TRUE) + + file.copy(file, paste0(path, "/", match[[5]])) + tools::write_PACKAGES(path, type = paste0(substring(match[[3]], 1, 3), ".binary"), verbose = TRUE) + } + + lib_names <- sub("r-libarrow-", "", libs) + lib_match <- regmatches(lib_names, regexec("([[:alpha:]]+)-(.+)", lib_names)) + + dir.create("repo/libarrow/bin/windows", recursive = TRUE) + dir.create("repo/libarrow/bin/centos-7", recursive = TRUE) + dir.create("repo/libarrow/bin/ubuntu-18.04", recursive = TRUE) + + for (match in lib_match) { + path <- list.files("repo//libarrow//bin", pattern = match[[2]], full.names = TRUE) Review Comment: You may want to use `file.path()` instead, which will handle windows vs. not windows path separators. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
