Skip to content

Commit

Permalink
upload with cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Nov 8, 2024
1 parent 273cb99 commit 51e99d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run_archive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
tag: ${{ fromJson(needs.create_release.outputs.releases) }}
env:
GITHUB_PAT: ${{ secrets.NFLVERSE_GH_TOKEN }}
GH_TOKEN: ${{ secrets.NFLVERSE_GH_TOKEN }}
R_KEEP_PKG_SOURCE: yes
NFLVERSE_ARCHIVE_TAG: ${{ matrix.tag }}
NFLVERSE_ARCHIVE_TO: ${{ needs.create_release.outputs.release_tag }}
Expand Down
13 changes: 5 additions & 8 deletions R/archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ nflverse_archive <- function(release_name, archive_tag){
file.path(temp_dir,release_name, paste0(release_name,"_",file_list))
)

memoise::forget(piggyback::pb_releases)
memoise::forget(piggyback:::pb_info)
Sys.sleep(5)

cli::cli_alert_info("Uploading Files to {.path nflverse/nflverse-data-archives@{archive_tag}}")
piggyback::pb_upload(
file = list.files(file.path(temp_dir,release_name),full.names = TRUE),
# cli::cli_alert_info("Uploading Files to {.path nflverse/nflverse-data-archives@{archive_tag}}")
gh_cli_release_upload <- function(
files = list.files(file.path(temp_dir, release_name), full.names = TRUE),
tag = archive_tag,
repo = "nflverse/nflverse-data-archives",
tag = archive_tag
overwrite = TRUE
)

cli::cli_alert_success("Successfully archived {release_name}")
Expand Down

0 comments on commit 51e99d7

Please sign in to comment.