Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release workflow improvements #106

Merged
merged 11 commits into from
Mar 31, 2024
Prev Previous commit
Next Next commit
Replace R-based version check with bash script in release.yaml
  • Loading branch information
pdil committed Mar 31, 2024
commit c8794a3de5ad76e69fb58ada41d5d58cb69bc400
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