Skip to content

Commit

Permalink
127 run autoconf or autoreconf and commit configure file when creatin…
Browse files Browse the repository at this point in the history
…g new release branch (#130)

* automatically regenerate configure file

* avoid hardcoding branch

* Revert "avoid hardcoding branch"

This reverts commit 1e43957.

* targeting the latest release branch for the status badge

* automatically update status badges

* capture all version strings in release-x.y.z
  • Loading branch information
j-i-l authored Jul 18, 2024
1 parent 6228fed commit 236ec8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/initiate_version_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
echo "VERSION=`echo $(echo '${{ github.ref_name }}'|grep -Eo '[0-9]+.[0-9]+.[0-9]+')`" >> $GITHUB_OUTPUT
echo "PREVIOUS_VERSION=`echo $(git tag --list --sort=version:refname | grep -E '^[0-9]+.[0-9]+.[0-9]+$' | tail -n1)`" >> $GITHUB_OUTPUT
echo "AUTHOR=`echo $(git log -1 --pretty=%an)`" >> $GITHUB_OUTPUT
- name: Get git-chglog and update CHANGELOG
run: |
wget ${{ env.CHGLOG_PATH }}/${{ env.CHGLOG_RELEASE}}.tar.gz # get the binary for the chglog
Expand All @@ -63,10 +64,12 @@ jobs:
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install desc to update DESCRIPTION file
run: |
install.packages(c("desc"))
shell: Rscript {0}

- name: Update DESCRIPTION file
run: |
df = desc::description$new(file='DESCRIPTION')
Expand All @@ -80,6 +83,16 @@ jobs:
sed -i -e '/^AC_INIT/s/[0-9]\+.[0-9]\.[0-9]\+/${{ steps.release_version.outputs.version }}/g' configure.ac
shell: bash

- name: Generate the configure file
run: |
sudo apt-get -y install autoconf
autoreconf
- name: Update status badges in the readme file
run: |
# updated the branch parameter for all badges
sed -i -e "s/?branch=release-[0-9]\+.[0-9]\.[0-9]\+/?branch=release-${{ steps.release_version.outputs.version}}/g" README.md
- name: Create version release Pull Request
id: release_pr
# NOTE: We might want to perform this step with gh cli natively
Expand All @@ -89,9 +102,11 @@ jobs:
commit-message: "Version ${{ steps.release_version.outputs.version }}"
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
README.md
NEWS.md
DESCRIPTION
configure.ac
configure
delete-branch: true # NOTE: No immediate delete after merge, instead branches with no diff are deleted
title: Release version ${{ steps.release_version.outputs.version }}
body: |
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# abn: Additive Bayesian Networks <a href="https://r-bayesian-networks.org/"><img src="man/figures/logo.png" align="right" height="139" /></a>

<!-- badges: start -->
<!-- WARNING: -->
<!-- The ?branch=release-x.y.y is updated automatically by the initiate_version_release workflow -->
[![status](https://joss.theoj.org/papers/1bbc43a2be86f5d3f831cedb5cf81812/status.svg)](https://joss.theoj.org/papers/1bbc43a2be86f5d3f831cedb5cf81812)
[![On Label CRAN Checks](https://github.com/furrer-lab/abn/actions/workflows/onlabel_CRAN_checks.yml/badge.svg)](https://github.com/furrer-lab/abn/actions/workflows/onlabel_CRAN_checks.yml)
[![On Label CRAN Checks](https://github.com/furrer-lab/abn/actions/workflows/onlabel_CRAN_checks.yml/badge.svg?branch=release-3.1.1)](https://github.com/furrer-lab/abn/actions/workflows/onlabel_CRAN_checks.yml)
[![Codecov](https://img.shields.io/codecov/c/github/furrer-lab/abn)](https://app.codecov.io/gh/furrer-lab/abn)
[![GitHub R package version](https://img.shields.io/github/r-package/v/furrer-lab/abn)](https://github.com/furrer-lab/abn/tags)
![cran](https://www.r-pkg.org/badges/version-ago/abn)
Expand Down

0 comments on commit 236ec8a

Please sign in to comment.