-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
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,27 @@ | ||
#!/usr/bin/perl | ||
|
||
open(R_VERSION, "grep 'Version' DESCRIPTION |"); | ||
$version = <R_VERSION>; | ||
close(R_VERSION); | ||
|
||
$version =~ /(\d+)\.(\d+)\.(\d+)/; | ||
$r_major = $1; | ||
$r_minor = $2; | ||
$r_mod = $3; | ||
|
||
open(GIT_VERSION, "git describe --tags |"); | ||
$git = <GIT_VERSION>; | ||
close(GIT_VERSION); | ||
|
||
$git =~ /v(\d+)\.(\d+)\.(\d+)/; | ||
$git_major = $1; | ||
$git_minor = $2; | ||
$git_mod = $3; | ||
|
||
if ($r_major > $git_major || $r_minor > $git_minor || $r_mod > $git_mod) { | ||
$new_version = "v$r_major.$r_minor.$r_mod"; | ||
} else { | ||
$new_version = ""; | ||
} | ||
|
||
print($new_version); |
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,31 @@ | ||
#!/bin/bash | ||
set -o errexit -o nounset | ||
addToDrat(){ | ||
PKG_REPO=$PWD | ||
|
||
## Build package tar ball | ||
export PKG_TARBALL=$(ls *.tar.gz) | ||
|
||
cd ..; mkdir drat; cd drat | ||
|
||
## Set up Repo parameters | ||
git init | ||
git config user.name "Martijn Schuemie" | ||
git config user.email "[email protected]" | ||
git config --global push.default simple | ||
|
||
## Get drat repo | ||
git remote add upstream "https://$GH_TOKEN@github.com/OHDSI/drat.git" | ||
git fetch upstream 2>err.txt | ||
git checkout gh-pages | ||
|
||
## Link to local R packages | ||
echo 'R_LIBS=~/Rlib' > .Renviron | ||
|
||
Rscript -e "drat::insertPackage('$PKG_REPO/$PKG_TARBALL', \ | ||
repodir = '.', \ | ||
commit='GitHub Actions release: $PKG_TARBALL run $GITHUB_RUN_ID')" | ||
git push | ||
|
||
} | ||
addToDrat |