Skip to content

Commit

Permalink
Merge branch 'devel' into renovate/actions-checkout-4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSajid authored May 24, 2024
2 parents 03872f5 + 5e14e70 commit 2580ca1
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.99.600
current_version = 0.99.632
commit = True
commit_args = --no-verify
tag = True
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/create_github_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
on:
push:
branches:
- devel
- RELEASE*
- ci/*

name: Create Github Release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag_version: ${{ steps.create_release.outputs.tag_version }}
steps:
- name: Install Act dependencies
if: ${{ env.ACT }}
run: |
apt-get update && apt-get install gh
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0
- name: Get most recent tag
id: get_tag
run: echo "TAG_VERSION=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
echo "Creating release for tag $TAG_VERSION"
gh release create $TAG_VERSION --title "Release $TAG_VERSION" --notes "Release $TAG_VERSION" --target ${{ github.ref }}
echo "tag_version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
create_release_artifacts:
needs: [create-release]
permissions:
contents: write
strategy:
fail-fast: false
matrix:
r_version: ['release', 'devel']
runs-on: ubuntu-latest
steps:
- name: Install Act dependencies
if: ${{ env.ACT }}
run: |
apt-get update && apt-get install gh
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Install system dependencies
run: |
sudo apt-get install -y libxml2-dev \
libssl-dev libcurl4-openssl-dev \
libharfbuzz-dev libfribidi-dev \
pandoc
- name: Setup R
uses: r-lib/actions/setup-r@929c772977a3a13c8733b363bf5a2f685c25dd91 # v2.9.0
with:
r-version: ${{ matrix.r_version }}
use-public-rspm: true
id: r
- name: Install dependencies
uses: r-lib/actions/setup-renv@929c772977a3a13c8733b363bf5a2f685c25dd91 # v2.9.0
- name: Build Package
run: R CMD build .
- name: Rename Package
run: echo "NEWNAME=$(./utilities/rename-package.R *.tar.gz)" >> "$GITHUB_ENV"
- name: debug
run: |
echo "R version: ${{ steps.r.outputs.installed-r-version }}"
echo "Current Tag: ${{ needs.create-release.outputs.tag_version }}"
echo "Release File Name: ${{ env.NEWNAME }}"
- name: Upload Release Artifact
env:
RELEASE_TAG: ${{ needs.create-release.outputs.tag_version }}
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ env.RELEASE_TAG }} ${{ env.NEWNAME }}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: drugfindR
Title: Investigate iLINCS for candidate repurposable drugs
Version: 0.99.600
Version: 0.99.632
Authors@R: c(
person(given = c("Ali", "Sajid"),
family = "Imami",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/CogDisResLab/drugfindR",
"issueTracker": "https://github.com/CogDisResLab/drugfindR/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.99.600",
"version": "0.99.632",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
5 changes: 5 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ AURKBP
AURKC
Austricin
aut
automerge
AUY
Avagacestat
Avanafil
Expand Down Expand Up @@ -3673,6 +3674,7 @@ GeneSymbol
GeneTargets
Genistein
Genz
geometricPrecision
Geraniol
Geranyl
Geranylgeraniol
Expand Down Expand Up @@ -4484,6 +4486,7 @@ Imami
Imatinib
IMD
IMEXON
img
imidazo
imidazol
imidazolidine
Expand Down Expand Up @@ -5375,6 +5378,7 @@ MASCRNA
Masitinib
MASP
MASTL
matchManagers
MATK
MATN
MATR
Expand Down Expand Up @@ -6798,6 +6802,7 @@ PABPN
pacakge
PACC
PACERR
packageRules
PACRG
PACRGL
PACS
Expand Down
21 changes: 21 additions & 0 deletions man/figures/lifecycle-soft-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"pre-commit": {
"enabled": true
},
"packageRules": [
{
"automerge": true,
"matchManagers": [
"pre-commit"
]
}
],
"platformCommit": true,
"schedule": [
"after 10pm and before 5am every weekday",
Expand Down
1 change: 1 addition & 0 deletions utilities/bump-version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

# Get the commit message of the latest commit
commit_message=$(git log -1 --pretty=%B)
Expand Down
39 changes: 39 additions & 0 deletions utilities/rename-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env -S Rscript --vanilla

# This script takes in a name and renames it to include the current R
# version and the current platform. It is intended to be used to rename
# packages that are being uploaded to releases on GitHub.

## Parse the first argument as the package name + package version
args <- commandArgs(trailingOnly = TRUE)
if (length(args) != 1L) {
stop("Usage: rename-package.R <package-name>")
}

message("Received package name: ", args[[1L]])

packageName <- strsplit(args, "_")[[1L]][[1L]]
message("Package name: ", packageName)
packageVersion <- strsplit(args, "_")[[1L]][[2L]]
message("Package version: ", packageVersion)

newName <- paste(
packageName, paste("R",
getRversion(),
sep = "-"
),
paste0("v", packageVersion),
sep = "_"
)

message("Renaming package to: ", newName)

value <- file.rename(args[[1L]], newName)

if (value) {
message("Successfully renamed package to: ", newName)
cat(newName)
} else {
stop("Failed to rename package to: ", newName)
cat("")
}

0 comments on commit 2580ca1

Please sign in to comment.