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

feature: automate tagging an releasing #81

Merged
merged 143 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5b10500
feature: automate tagging an releasing
j-i-l Apr 16, 2024
95772b4
debugging release job
j-i-l Apr 16, 2024
af5d841
using r-container to publish
j-i-l Apr 16, 2024
e3d2a12
fixing denied on docker pull
j-i-l Apr 16, 2024
e5b5a62
image is public now - no creds needed
j-i-l Apr 16, 2024
7a1436f
feature: automated release
j-i-l Apr 16, 2024
2946ec4
Merge branch 'main' into streamline-release-process
j-i-l Apr 22, 2024
6ba4ab4
allow label creation to fail
j-i-l May 12, 2024
7b96023
initiation for version release
j-i-l May 12, 2024
e9f3ac6
adding what remains to do for verison update
j-i-l May 12, 2024
0bcf2be
adding version publishing workflow
j-i-l May 12, 2024
8cb272a
streamlinging version release
j-i-l May 12, 2024
24ef7a2
Remove redundant file
j-i-l May 12, 2024
f5a606e
Merge branch 'main' into streamline-release-process
j-i-l May 12, 2024
fd35a13
fix: typeo in running condition
j-i-l May 12, 2024
0f36156
renaming some worklfows
j-i-l May 12, 2024
65e5a32
allow to publish version before merge
j-i-l May 12, 2024
b1d5cdc
attach build package to release
j-i-l May 12, 2024
92ff98d
minor cleanup
j-i-l May 12, 2024
760f500
adapting the enforce worklfow
j-i-l May 12, 2024
5a83ba3
adding workflow for development branches
j-i-l May 12, 2024
4ef0fef
adding development run
j-i-l May 12, 2024
7ed55b8
removing old version of dev workflow
j-i-l May 12, 2024
e5c17e4
typeo
j-i-l May 12, 2024
be88c9b
formatting fixed
j-i-l May 12, 2024
8e4c47e
simplify condition
j-i-l May 12, 2024
674cf98
change ot on pr condition for event
j-i-l May 12, 2024
1103b40
cleaning up
j-i-l May 12, 2024
be414cf
writing lists of files
j-i-l May 12, 2024
ab54319
running tests always
j-i-l May 12, 2024
330ce2c
avoid bulding the package in each tests
j-i-l May 12, 2024
e734917
still building and installing it
j-i-l May 12, 2024
6b25f0f
slightly better naming
j-i-l May 12, 2024
8a8b2df
26 tests tracking memory usage the slow pipeline (#89)
j-i-l May 13, 2024
43b5e0a
fix: do not run on release- branches
j-i-l May 13, 2024
5a42680
started with pkgdown integration
j-i-l May 13, 2024
620fa00
updating version and date
j-i-l May 16, 2024
979fc0b
declare source
j-i-l May 16, 2024
94a28eb
adding linting and url check on demand
j-i-l May 16, 2024
82d63e5
first check what label was used
j-i-l May 16, 2024
7168646
fixing wrong label names
j-i-l May 16, 2024
08746c1
better starting condition check
j-i-l May 16, 2024
19df026
assert labels are present when reporting
j-i-l May 16, 2024
dbf9e07
fixing wrong target label
j-i-l May 16, 2024
0419bf4
simplify label check
j-i-l May 16, 2024
12f8d0f
cleaning up prev. outcomes
j-i-l May 16, 2024
f99316d
allow workflow be set to skipped if label dont match
j-i-l May 16, 2024
a0ee15e
fixing naming mismatch
j-i-l May 16, 2024
96c21a4
fixing output passthrough
j-i-l May 16, 2024
e3215bc
unnecessary condition since need
j-i-l May 16, 2024
6c79045
cleaning up and fixin on label CRAN
j-i-l May 16, 2024
8931550
better cleaning up of status labels
j-i-l May 16, 2024
45a02ef
typeo
j-i-l May 16, 2024
f8b0d4f
combining the conditions lint+URL
j-i-l May 16, 2024
dc37730
run aftermath also on failure
j-i-l May 16, 2024
c688ea7
forgot repo in labeling command
j-i-l May 16, 2024
484ef18
fixing cleanup of labels
j-i-l May 16, 2024
2282be6
feature: use labels to trigger checks in release PR
j-i-l May 16, 2024
d5afbcd
follow identical naming scheme
j-i-l May 16, 2024
29f3609
cleaning up
j-i-l May 16, 2024
d3759d1
adding config for chglog generation
j-i-l May 16, 2024
808eae3
bug fix in r script
j-i-l May 16, 2024
c31d071
started to clean up
j-i-l May 16, 2024
64ed7d5
bug fix in configrue.ac name
j-i-l May 16, 2024
467dff1
only run on -rc tag on main
j-i-l May 16, 2024
d0be9e4
fixing label cleanup
j-i-l May 16, 2024
d23e5d1
build pkgdown on label
j-i-l May 16, 2024
8fe0e85
better handling of access creds; fixing release prep
j-i-l May 16, 2024
8967fc8
include pkgdown build
j-i-l May 16, 2024
e7ee7ef
debug - allow to run on this branch
j-i-l May 16, 2024
dc48243
fixing typon in requested container
j-i-l May 17, 2024
334e920
typeo
j-i-l May 17, 2024
ec2d4da
fixing upload path
j-i-l May 17, 2024
3464688
do not label with gh-token as not trigger
j-i-l May 17, 2024
c773f41
rename workflow
j-i-l May 17, 2024
7188b6d
setting permissions to create labels
j-i-l May 17, 2024
12e217c
explicitely specify permissins for label creation
j-i-l May 17, 2024
c48f17a
to revert - allow tags on dev branch
j-i-l May 17, 2024
5873f89
Version 3.0.9
j-i-l May 17, 2024
08979b8
fixing typeos
j-i-l May 17, 2024
a3f4242
fixing typeos ++
j-i-l May 17, 2024
5029633
fixing starting condition
j-i-l May 17, 2024
9cc45c7
better starting condition for forced release
j-i-l May 17, 2024
791d139
make sure the previous title is formatted correctly
j-i-l May 17, 2024
1f37eb0
install deps for pgkdown
j-i-l May 17, 2024
38350b5
cleaning up; only lint on push to release branch
j-i-l May 17, 2024
00b2221
separate pkdown and package build
j-i-l May 17, 2024
085dba2
fixing titles
j-i-l May 17, 2024
d8eb7da
setting NEWS.md title to hopefully work with pkddonw
j-i-l May 17, 2024
48ff602
Merge branch 'streamline-release-process' into release-3.0.9
j-i-l May 17, 2024
68c0ef8
Merge pull request #96 from furrer-lab/release-3.0.9
j-i-l May 17, 2024
8db27d2
proper pkgdown install and separation
j-i-l May 17, 2024
edb404b
cleaning up NEWS.md from release attempt
j-i-l May 17, 2024
6baec4a
fixing typeo
j-i-l May 17, 2024
2e52366
hardcoding abn in news template
j-i-l May 17, 2024
00fb83a
Version 3.0.8
j-i-l May 17, 2024
f57d767
forgot some titles
j-i-l May 17, 2024
44a5ce0
making extra clean titles
j-i-l May 17, 2024
924f51e
debugging
j-i-l May 18, 2024
9d419ba
fixing several wrong varible names
j-i-l May 18, 2024
975c7f8
fixing several wrong varible names
j-i-l May 18, 2024
004371a
fixed path to artifact
j-i-l May 19, 2024
4338af6
Merge branch 'release-3.0.8' of github.com:furrer-lab/abn into releas…
j-i-l May 19, 2024
5d09716
fixing package updload command
j-i-l May 19, 2024
5872187
adding missing permissions for pages publishing
j-i-l May 19, 2024
121fca5
skip all steps if labeled as published
j-i-l May 19, 2024
dc0009e
needs argument from step not prev. job
j-i-l May 19, 2024
ce2aa77
bring published label check foward
j-i-l May 19, 2024
0b39355
adapt header to match tag name
j-i-l May 19, 2024
7362779
doing some cleanup of the changelog
j-i-l May 19, 2024
d6e27af
anticipating the check for publishing
j-i-l May 19, 2024
204c48c
bug fix
j-i-l May 19, 2024
eeb8c47
bug fix: get pr from step
j-i-l May 19, 2024
f749247
Merge pull request #97 from furrer-lab/release-3.0.8
j-i-l May 19, 2024
6ab2c82
fixing typeo
j-i-l May 19, 2024
5992318
using app token to add labels
j-i-l May 19, 2024
908ad45
also accept label ::passed as condition
j-i-l May 19, 2024
c6a716d
revert update from release dry-run
j-i-l May 19, 2024
1251ff6
Version 3.0.8
j-i-l May 19, 2024
21a7d74
fixing wrong job name
j-i-l May 19, 2024
d83227f
always run the final check
j-i-l May 19, 2024
79c5b85
fixing condition
j-i-l May 19, 2024
76ad0a3
renaming
j-i-l May 19, 2024
b06b97c
adapting the checks to factor in label presence
j-i-l May 19, 2024
bea7de2
reverting changes introduced by release initiation
j-i-l May 19, 2024
f92b9f3
including ::passed label presence option
j-i-l May 19, 2024
409e45e
uniform naming
j-i-l May 19, 2024
2f6cacc
Merge pull request #98 from furrer-lab/release-3.0.8
j-i-l May 19, 2024
6613595
targeted testfiles
j-i-l May 20, 2024
a23f2a0
to revert - removing space
j-i-l May 20, 2024
bcb93fc
fixing bash script to select testfiles
j-i-l May 20, 2024
fcd0027
to revert - change to trigger tests
j-i-l May 20, 2024
778d6ce
to revert - trigger change in SRC
j-i-l May 20, 2024
37e72cd
fix: forgot to add the variable to gh output
j-i-l May 20, 2024
e4bf47b
reverting test triggers
j-i-l May 20, 2024
d8a7894
fix: skip dont fail on empty list
j-i-l May 20, 2024
e56250a
better naming
j-i-l May 20, 2024
0fe457c
to revert: trigger a test
j-i-l May 20, 2024
76eed5c
Revert "better naming"
j-i-l May 20, 2024
3b823dc
better naming
j-i-l May 20, 2024
a56433d
Revert "to revert: trigger a test"
j-i-l May 20, 2024
44c9962
cleaning up
j-i-l May 20, 2024
5ef2935
Merge branch 'main' into streamline-release-process
j-i-l May 20, 2024
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
40 changes: 40 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{ range .Versions }}
# abn {{ .Tag.Name }}
{{ if .Tag.Previous }}[diff]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }}

> {{ datetime "2006-01-02" .Tag.Date }}

{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts

{{ range .RevertCommits -}}
* {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .MergeCommits -}}
### Pull Requests

{{ range .MergeCommits -}}
* {{ .Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
29 changes: 29 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/furrer-lab/abn
options:
sort: "semver"
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
# title_maps:
# feat: Features
# fix: Bug Fixes
# perf: Performance Improvements
# refactor: Code Refactoring
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
151 changes: 0 additions & 151 deletions .github/workflows/CRAN_checks.yml

This file was deleted.

130 changes: 130 additions & 0 deletions .github/workflows/development_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Workflow triggered when we have a new release candidate
# This action is adapted from https://github.com/t4d-gmbh/stubbed_versioning
name: Runs on non-release pull requests

on:
pull_request:
branches:
- "*" # run for any pull request (see 1st job if condition for head name selection)
jobs:
should-run:
if: ${{ (github.ref != 'refs/heads/main') && (!startsWith(github.head_ref, 'release-')) && (!startsWith(github.event.head_commit.message, 'noT')) }}
runs-on: ubuntu-latest
steps:
- name: Info
run: |
echo "Running development tests for branch ${{ github.head_ref }}"

get-target-container:
needs: should-run
runs-on: ubuntu-22.04
outputs:
CONTAINER: ${{ steps.container.outputs.container }}
steps:
- name: Get container
id: container
env:
BRANCH: ${{ github.ref_name }}
run: |
if [[ $BRANCH == *"__"* ]]; then
echo "container=${BRANCH##*__}" >> $GITHUB_OUTPUT
else
echo "container=debian/clang/devel" >> $GITHUB_OUTPUT
fi
get_changes:
needs: should-run
runs-on: ubuntu-latest
outputs:
run_all: ${{ steps.changed_files.outputs.changed_src }}
run_specific: ${{ steps.changed_files.outputs.changed_r }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
steps:
- uses: actions/checkout@v4
- name: Find changed files
id: changed_files
run: |
echo "CHANGED_SRC=$(gh pr view ${{ env.EVENT }} --json 'files' --jq '.[].[] | select(.path | startswith("src/")) | .path' | xargs | sed -e 's/ /,/g')" >> $GITHUB_OUTPUT
echo "CHANGED_R=$(gh pr view ${{ env.EVENT }} --json 'files' --jq '.[].[] | select(.path | startswith("R/")) | .path' | xargs | sed -e 's/ /,/g')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT

gather-tests:
needs:
- get_changes
runs-on: ubuntu-latest
outputs:
testfiles: ${{ steps.get_testfiles.outputs.testfiles }}
steps:
- uses: actions/checkout@v4
- name: Identify tests to run
id: get_testfiles
run: |
if [[ -z "${{ needs.get_changes.outputs.run_all }}" ]]; then
if [[ -n "${{ needs.get_changes.outputs.run_specific }}" ]]; then
echo "TESTFILES=$(echo ${{ needs.get_changes.outputs.run_specific }} | sed -e 's/^R\//\"tests\/testthat\/test-/g' -e 's/,R\//,\"tests\/testthat\/test-/g' | sed -e 's/.R/.R\"/g' | sed 's/.*/[\0]/')" >> $GITHUB_OUTPUT
else
echo "TESTFILES=[]" >> $GITHUB_OUTPUT
fi
else
echo "TESTFILES=$(ls tests/testthat/test-*.R | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
fi
cat $GITHUB_OUTPUT

build-install-test:
if: ${{ ( needs.gather-tests.outputs.testfiles != '[]' ) }}
needs:
- gather-tests
- get-target-container
runs-on: ubuntu-22.04
# name: Testing ${{ matrix.os }} (${{ matrix.compiler}}-${{ matrix.r-version }})
name: Testing in ${{ needs.get-target-container.outputs.CONTAINER }}
# runs-on: ubuntu-latest
container:
image: ${{ vars.CONTAINER_SOURCE }}/${{ needs.get-target-container.outputs.CONTAINER }}/abn:${{ vars.CONTAINER_VERSION || 'latest' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
testfile: ${{ fromJson(needs.gather-tests.outputs.testfiles) }}
env:
R_KEEP_PKG_SOURCE: yes # NOTE Jo: not sure why this is here?
BUILD_LOC: "./build"

steps:
- uses: actions/checkout@v4
- name: Create build location
run: |
mkdir ${{ env.BUILD_LOC }}
shell: bash
- name: Disable renv
run: |
renv::deactivate()
shell: Rscript {0}
- name: Change permissions of configure
run: |
chmod +x configure
shell: bash
- name: Install package dependencies
run: |
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never')
shell: Rscript {0}
- name: Build the package
run: |
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz')
shell: Rscript {0}
- name: Install it
run: |
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
shell: Rscript {0}
- name: Running ${{ matrix.testfile }}
run: |
# since on a test failure devtools::test does not exit with
# non-zero state we test explicitly for failed tests and exit
# accordingly
res=devtools::test_active_file("${{ matrix.testfile }}");df=as.data.frame(res);if(sum(df$failed) > 0 || any(df$error)) {q("no", status=1, FALSE)}
shell: Rscript {0}
Loading
Loading