Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ name: R CMD Check & Build
on:
push:
branches: [ main, master ]
tags:
- 'v*'
pull_request:
branches: [ main, master ]
workflow_dispatch:

jobs:
R-CMD-check:
outputs:
full_version: ${{ steps.dynamic_version.outputs.FULL_VERSION }}
pkg_file: ${{ steps.build.outputs.PKG_FILE }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -21,7 +27,7 @@ jobs:
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.5.0'
r-version: 'release'

- name: Read version from .ver file
id: get_version
Expand All @@ -33,7 +39,13 @@ jobs:

- name: Construct dynamic version string
id: dynamic_version
run: echo "FULL_VERSION=${{ steps.get_version.outputs.VERSION }}.${{ steps.get_sha.outputs.SHA }}" >> $GITHUB_OUTPUT
run: |
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
VERSION="${GITHUB_REF_NAME#v}"
else
VERSION="${{ steps.get_version.outputs.VERSION }}.${{ steps.get_sha.outputs.SHA }}"
fi
echo "FULL_VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Update DESCRIPTION file with dynamic version
run: |
Expand Down Expand Up @@ -72,3 +84,26 @@ jobs:
with:
name: processcontrol-${{ steps.dynamic_version.outputs.FULL_VERSION }}
path: ${{ steps.build.outputs.PKG_FILE }}

release:
needs: R-CMD-check
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: processcontrol-${{ needs.R-CMD-check.outputs.full_version }}
path: dist

- name: List packaged files
run: ls -R dist

- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: processcontrol ${{ needs.R-CMD-check.outputs.full_version }}
files: dist/${{ needs.R-CMD-check.outputs.pkg_file }}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Description: Generate time series chart for individual values with mean and +/-
3 standard deviation lines and the corresponding mR chart with the upper control
limit. Also execute the 8 Shewhart stability run tests and display the violations.
Depends:
R (>= 4.5.0)
R (>= 4.0.0)
License: MIT + file LICENSE
LazyData: TRUE
Imports:
Expand Down
Loading