Skip to content

Commit

Permalink
Replace R-based version check with bash script in release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
pdil committed Mar 31, 2024
1 parent 1264640 commit c8794a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
6 changes: 0 additions & 6 deletions .github/workflow-resources/version-check.R

This file was deleted.

25 changes: 10 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Check version number
run: |
current_version=$(echo "$(cat DESCRIPTION)" | grep "Version:" | awk '{print $2}')
input_version="${{ steps.read_version.outputs.version }}"
if [ "$(printf '%s\n' "$input_version" "$current_version" | sort -V | head -n1)" = "$input_version" ]; then
echo "::error title=Invalid version::Provided version number must be higher than the current version (${{ inputs.version }})."
exit 1
fi
- name: Setup R
uses: r-lib/actions/setup-r@v2

Expand All @@ -29,21 +39,6 @@ jobs:
any::rhub
github::r-lib/revdepcheck
- name: Check version number
env:
VERSION: ${{ inputs.version }}
run: |
source(".github/workflow_resources/version-check.R")
verify_version(Sys.getenv("VERSION"))
shell: Rscript {0}

- name: Version number error
run: |
if [ "$INVALID_VERSION" = "true" ]; then
echo "::error title=Invalid version::Provided version number must be higher than the current version (${{ inputs.version }})"
exit 1
fi
- name: Run release checks
env:
EMAIL: ${{ secrets.RHUB_EMAIL }}
Expand Down

0 comments on commit c8794a3

Please sign in to comment.