Skip to content

Commit

Permalink
Move to before-install
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Sep 21, 2023
1 parent 99f3537 commit e039be4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 42 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/custom/after-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,6 @@ runs:
max-size: 200M
verbose: 1

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true

- name: Environment before RUNNER_TEMP
run: |
env | sort
shell: bash

- name: Download DuckDB binary
run: |
# FIXME: only for stable version, other code for dynamic version
tempdir <- Sys.getenv("RUNNER_TEMP")
runner_os <- "${{ runner.os }}"
if (runner_os == "Linux") {
file <- "libduckdb-linux-amd64.zip"
} else if (runner_os == "Windows") {
file <- "libduckdb-windows-amd64.zip"
} else if (runner_os == "macOS") {
file <- "libduckdb-osx-universal.zip"
}
zipfile <- file.path(tempdir, "libduckdb.zip")
bindir <- file.path(tempdir, "libduckdb")
# FIXME: dynamic detection of version number
download.file(file.path("https://github.com/duckdb/duckdb/releases/download", "v0.8.1", file), zipfile)
unzip(zipfile, exdir = bindir)
writeLines(
paste0("DUCKDB_BINARY_PATH=", bindir),
Sys.getenv("GITHUB_ENV")
)
shell: Rscript {0}

- name: Show DUCKDB_BINARY_PATH
run: |
echo $DUCKDB_BINARY_PATH
shell: bash

- name: Install to avoid R CMD INSTALL --pre-clean run otherwise
run: |
mkdir ../lib
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/custom/before-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,35 @@ runs:
with:
path: ${{ env.DUCKDB_R_PREBUILT_ARCHIVE }}
key: ${{ env.DUCKDB_R_PREBUILT_ARCHIVE_GHA_CACHE_KEY }}

- name: Download DuckDB binary
run: |
# FIXME: only for stable version, other code for dynamic version
tempdir <- Sys.getenv("RUNNER_TEMP")
runner_os <- "${{ runner.os }}"
if (runner_os == "Linux") {
file <- "libduckdb-linux-amd64.zip"
} else if (runner_os == "Windows") {
file <- "libduckdb-windows-amd64.zip"
} else if (runner_os == "macOS") {
file <- "libduckdb-osx-universal.zip"
}
zipfile <- file.path(tempdir, "libduckdb.zip")
bindir <- file.path(tempdir, "libduckdb")
# FIXME: dynamic detection of version number
download.file(file.path("https://github.com/duckdb/duckdb/releases/download", "v0.8.1", file), zipfile)
unzip(zipfile, exdir = bindir)
writeLines(
paste0("DUCKDB_BINARY_PATH=", bindir),
Sys.getenv("GITHUB_ENV")
)
shell: Rscript {0}

- name: Show DUCKDB_BINARY_PATH
run: |
echo $DUCKDB_BINARY_PATH
shell: bash

0 comments on commit e039be4

Please sign in to comment.