Skip to content

Commit

Permalink
getting TAR URL via curl
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-silverman authored Feb 20, 2025
1 parent a5ddf4c commit ce8b40a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/installation_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ jobs:
brew install freetype udunits cairo harfbuzz fribidi libpng libtiff jpeg gdal pkg-config
fi
- name: Get latest tar.gz URL
if: matrix.install-method == 'url'
run: |
TAR_URL=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tarball_url')
echo "TAR_URL=$TAR_URL" >> $GITHUB_ENV
- name: Install EJAM (method- ${{ matrix.install-method }})
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -61,17 +67,8 @@ jobs:
INSTALL_opts = c("--with-keep.source", "--install-tests")
)
} else {
# figure out the URL of the most recent release
install.packages("gh")
url_latest_release = function(owner_repo) {
x = gh::gh(paste0("/repos/",owner_repo,"/releases"))
dates = sapply(x, function(z) z$published_at)
latest_url = x[[which.max(as.Date(dates))]]$tarball_url
return(latest_url)
}
remotes::install_url(
url = url_latest_release(owner_repo = "${{ github.repository }}"),
url = ${{ TAR_URL }},
#url = "https://github.com/USEPA/EJAM-open/archive/refs/tags/v2.32.1.tar.gz",
dependencies = TRUE,
auth_token = ""
Expand Down

0 comments on commit ce8b40a

Please sign in to comment.