Skip to content

Commit

Permalink
Add a workflow step to increase dev version automatically
Browse files Browse the repository at this point in the history
+ refactor all jobs in one main workflow
  • Loading branch information
Felixmil committed Jul 3, 2024
1 parent 38a97d8 commit 819e7d5
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 54 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/R-CMD-check.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/increase-dev-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: increase-dev-version

on:
workflow_call:

jobs:
change-version:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions: write-all
steps:
- uses: actions/checkout@v4

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install packages
run: |
install.packages("usethis")
shell: Rscript {0}

- name: Change DESCRIPTION file
run: |
if(usethis:::is_dev_version()){
desc::desc_set_version(version = usethis:::bump_version()[["dev"]])
}
shell: Rscript {0}

- uses: EndBug/add-and-commit@v9
if: ${{ success() }}
with:
message: '🤖 Bump development version.'
default_author: github_actions
add: 'DESCRIPTION'
42 changes: 42 additions & 0 deletions .github/workflows/main-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Main-Workflow

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]


jobs:
increase-dev-version: # only do that when actually merging in main/develop branch
if: github.event_name != 'pull_request'
uses: ./.github/workflows/increase-dev-version.yaml
R-CMD-Check:
if: ${{ always() }}
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/R-CMD-check-build.yml@main
with:
install-pksim: true
install-rClr: true
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
test-coverage:
if: ${{ always() }}
needs: [R-CMD-Check]
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/test-pkg-and-coverage.yml@main
with:
install-pksim: true
install-rClr: true
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
pkgdown:
if: ${{ always() }}
needs: [R-CMD-Check]
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/pkgdown.yml@main
with:
install-pksim: true
install-rClr: true
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
18 changes: 0 additions & 18 deletions .github/workflows/pkgdown.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/test-coverage.yaml

This file was deleted.

0 comments on commit 819e7d5

Please sign in to comment.