Skip to content

Commit 7ddc299

Browse files
authored
Fix formatting when constructing NEWS.md in the upstream update GitHub Action (#33)
* Fix RcppEnsmallen version update Address space issue for NEWS entry bullets * only run devel in matrix * Add ChangeLog note * Add ability to manually trigger the workflow
1 parent 2fd9bfa commit 7ddc299

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- {os: macOS-latest, r: 'release'}
2222
- {os: windows-latest, r: 'release'}
2323
- {os: windows-latest, r: 'oldrel'}
24-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
24+
#- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2525
#- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2626
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2727

.github/workflows/upstream-refresh.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Update Ensmallen
22
on:
3+
workflow_dispatch:
34
schedule:
45
- cron: '0 10 * * *'
56
jobs:
@@ -46,22 +47,23 @@ jobs:
4647
# Begin work on formatting NEWS entry
4748
# Obtain the double quoted version name
4849
ENSMALLEN_VERSION_NAME=$(grep -i ".*#define ENS_VERSION_NAME.*" inst/include/ensmallen_bits/ens_version.hpp | grep -o '".*"')
50+
NEW_RCPPENSMALLEN_VERSION=0.${RELEASE_TAG}.1
4951
# Extract out the new changes using diff
5052
# Steps: Remove blank lines, delete header, replace * with -, indent by 1
5153
NEWS_UPDATE=$(diff --unchanged-group-format="" tools/HISTORY.md tools/HISTORYold.md | sed '/^$/d' | sed '/^#/d' | sed 's/\*/-/' | sed 's/^/ /')
5254
# Set the new history to be old
5355
mv tools/HISTORY.md tools/HISTORYold.md
5456
# Prepend new update notes to NEWS.md with a heredoc
5557
cat <<-EOF > NEWS.md
56-
# RcppEnsmallen ${RELEASE_TAG}
58+
# RcppEnsmallen ${NEW_RCPPENSMALLEN_VERSION}
5759
5860
- Upgraded to ensmallen ${RELEASE_TAG}: ${ENSMALLEN_VERSION_NAME} ($RELEASE_DATE)
59-
$(echo ${NEWS_UPDATE})
61+
${NEWS_UPDATE}
6062
6163
$(cat NEWS.md)
6264
EOF
6365
# Update R package version
64-
sed -i "s/Version:.*/Version: 0.${RELEASE_TAG}.1/g" DESCRIPTION
66+
sed -i "s/Version:.*/Version: ${NEW_RCPPENSMALLEN_VERSION}/g" DESCRIPTION
6567
# Prepend entry to ChangeLog with a heredoc
6668
TAB="$(printf '\t')"
6769
cat <<-EOF > ChangeLog

ChangeLog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
2020-08-22 James Balamuta <[email protected]>
22

33
* .github/workflows/R-CMD-check.yaml: Re-enable devel build check by
4-
using Linux instead of macOS to perform the check
4+
using Linux instead of macOS to perform the check.
5+
6+
* .github/workflows/upstream-refresh.yaml: Fix NEWS.md entry formatting
7+
issues.
58

69
2020-07-24 James Balamuta <[email protected]>
710

0 commit comments

Comments
 (0)