Skip to content

GitHub Actions refactor - #291

Merged
pdiakumis merged 12 commits into
devfrom
gha-refac-20260316
Mar 31, 2026
Merged

pdiakumis merged 12 commits into
devfrom
gha-refac-20260316

Conversation

@pdiakumis

Copy link
Copy Markdown
Collaborator

Making changes in prep for moving to gitflow development (i.e. main for stable releases, dev for merging and testing all feature branches).

  • dev branch handling:

    • both conda_build jobs and the conda_lock job now conditionally add a dev label channel when running on the dev branch:
      • build + lock: adds --channel pcgr/label/dev
      • upload: adds --channel dev
    • this ensures 'dev' conda deployments are not installable mistakenly by default by external users
  • Switch to rattler-build from conda mambabuild:

    • build + upload done separately (TODO: try using rattler-build publish that does both)
    • conda recipes needed to also change format
  • Conda environment setup: mamba-org/setup-micromamba => conda-incubator/setup-miniconda

  • conda_lock job changes

    • Lock files now target linux-64 only (osx-64 dropped)
      • pro: this will make it simpler to merge the pcgr/pcgrr pkgs into a single conda environment
      • con (potentially): bioconda requires osx builds (if we ever get to that)
    • New lock file format: named lock-pcgr.yaml / lock-pcgrr.yaml (YAML format), then rendered to explicit .lock files
  • pkgdown:

    • by using auto development mode, tagged versions in the form of x.y.z.patch will automatically get copied into the docs/dev folder, which means e.g. v2.2.5.9000 will be viewed under https://sigven.github.io/pcgr/dev instead of https://sigven.github.io/pcgr.
  • docker:

    • Login switches from Docker Hub to GitHub Container Registry (ghcr.io)

@pdiakumis
pdiakumis requested review from Copilot and sigven March 16, 2026 11:02
@pdiakumis pdiakumis self-assigned this Mar 16, 2026
@pdiakumis
pdiakumis marked this pull request as ready for review March 16, 2026 11:02
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Refactor GitHub Actions for rattler-build and gitflow development workflow

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Migrate from conda-mambabuild to rattler-build for package building
• Consolidate separate pcgr/pcgrr build jobs using matrix strategy
• Switch environment setup from micromamba to miniconda/miniforge
• Rename conda recipe format from meta.yaml to recipe.yaml (rattler-build compatible)
• Rename conda environment files from .yml to .yaml extension
• Update conda-lock to target linux-64 only, drop osx-64 support
• Enable pkgdown auto development mode for dev version documentation
• Switch Docker registry from Docker Hub to GitHub Container Registry (ghcr.io)
• Update GitHub Actions to latest versions (v4, v6, v7, v8)
• Add dev label channel support for dev branch conda deployments
Diagram
flowchart LR
  A["conda-mambabuild"] -->|"migrate to"| B["rattler-build"]
  C["separate build jobs"] -->|"consolidate with"| D["matrix strategy"]
  E["micromamba"] -->|"switch to"| F["miniconda/miniforge"]
  G["meta.yaml"] -->|"rename to"| H["recipe.yaml"]
  I["yml files"] -->|"rename to"| J["yaml files"]
  K["osx-64 + linux-64"] -->|"drop to"| L["linux-64 only"]
  M["Docker Hub"] -->|"migrate to"| N["ghcr.io"]
  O["main branch only"] -->|"add support"| P["dev branch with labels"]
Loading

Grey Divider

File Changes

1. .github/workflows/build_conda_recipes.yaml ✨ Enhancement +80/-68

Refactor conda build workflow with rattler-build and matrix strategy

.github/workflows/build_conda_recipes.yaml


2. conda/recipe/pcgr/recipe.yaml ✨ Enhancement +49/-0

Convert pcgr recipe to rattler-build format

conda/recipe/pcgr/recipe.yaml


3. conda/recipe/pcgrr/recipe.yaml ✨ Enhancement +23/-18

Convert pcgrr recipe to rattler-build format

conda/recipe/pcgrr/recipe.yaml


View more (13)
4. conda/recipe/pcgr/build.sh Miscellaneous +0/-4

Remove legacy conda-mambabuild build script

conda/recipe/pcgr/build.sh


5. conda/recipe/pcgrr/build.sh Miscellaneous +0/-4

Remove legacy conda-mambabuild build script

conda/recipe/pcgrr/build.sh


6. conda/recipe/pcgr/meta.yaml Miscellaneous +0/-35

Remove legacy conda-mambabuild recipe format

conda/recipe/pcgr/meta.yaml


7. conda/env/yaml/condabuild.yaml ✨ Enhancement +6/-0

Create new condabuild environment with rattler-build

conda/env/yaml/condabuild.yaml


8. conda/env/yaml/pcgr.yaml ✨ Enhancement +2/-2

Update pcgr environment with simplified dependencies

conda/env/yaml/pcgr.yaml


9. conda/env/yaml/pcgrr.yaml ✨ Enhancement +2/-2

Update pcgrr environment with simplified channel references

conda/env/yaml/pcgrr.yaml


10. conda/env/yaml/pkgdown.yaml ✨ Enhancement +1/-1

Update pkgdown environment with simplified channel references

conda/env/yaml/pkgdown.yaml


11. conda/env/yml/condabuild.yml Miscellaneous +0/-10

Remove legacy yml format condabuild environment

conda/env/yml/condabuild.yml


12. .bumpversion.toml ⚙️ Configuration changes +5/-5

Update file paths for yaml and recipe.yaml formats

.bumpversion.toml


13. pcgr/_version.py Miscellaneous +1/-2

Update version comment format for bump2version

pcgr/_version.py


14. pyproject.toml Miscellaneous +1/-1

Update version comment format for bump2version

pyproject.toml


15. pcgrr/DESCRIPTION ✨ Enhancement +1/-1

Update RoxygenNote to version 7.3.3

pcgrr/DESCRIPTION


16. pcgrr/pkgdown/_pkgdown.yml ✨ Enhancement +2/-0

Enable pkgdown auto development mode for dev versions

pcgrr/pkgdown/_pkgdown.yml


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Mar 16, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Bumpversion search mismatch 🐞 Bug ≡ Correctness
Description
.bumpversion.toml searches for "pcgrr =={current_version}" in conda env YAMLs, but those files now
pin "r-pcgrr ==…", so bumpversion will fail (or leave pins stale) on the next version bump. This
breaks the automated release workflow and can produce lockfiles/envs pinned to the wrong package
version.
Code

.bumpversion.toml[R57-65]

[[tool.bumpversion.files]]
-filename = "conda/env/yml/pcgrr.yml"
+filename = "conda/env/yaml/pcgrr.yaml"
search = "pcgrr =={current_version}"
replace = "pcgrr =={new_version}"
[[tool.bumpversion.files]]
-filename = "conda/env/yml/pkgdown.yml"
+filename = "conda/env/yaml/pkgdown.yaml"
search = "pcgrr =={current_version}"
replace = "pcgrr =={new_version}"
Evidence
bumpversion is configured to update conda env pins using a string that no longer exists after the
env dependency rename to r-pcgrr, so the version update won’t be applied (and with
ignore_missing_version=false it will error).

.bumpversion.toml[57-65]
conda/env/yaml/pcgrr.yaml[8-14]
conda/env/yaml/pkgdown.yaml[6-11]
.bumpversion.toml[7-9]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.bumpversion.toml` is configured to update conda env pins using a search string that no longer exists after the refactor (`pcgrr ==...`), while the env files now pin `r-pcgrr ==...`. With `ignore_missing_version = false`, bumpversion will fail (or it will not update the intended files), breaking release automation.
## Issue Context
The conda env YAML files were updated to use `r-pcgrr` as the dependency name. The bumpversion config needs to match that exact string.
## Fix Focus Areas
- .bumpversion.toml[57-65]
- conda/env/yaml/pcgrr.yaml[8-14]
- conda/env/yaml/pkgdown.yaml[6-11]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Stale macOS lockfiles ☑ 🐞 Bug ≡ Correctness
Description
The workflow now generates only linux-64 lockfiles, but macOS explicit lockfiles still exist in the
repo and the installation docs still instruct users to use them. On the next version bump, tagged
releases will ship outdated macOS lockfiles, making the documented macOS conda install path
incorrect.
Code

.github/workflows/build_conda_recipes.yaml[R79-85]

+          # handle dev branch with dev label channel
+          CHANNEL_ARGS="--channel ${{ env.conda_org }} --channel bioconda --channel conda-forge"
+          [[ "${{ github.ref }}" == "refs/heads/dev" ]] && CHANNEL_ARGS="--channel ${{ env.conda_org }}/label/dev ${CHANNEL_ARGS}"
+          conda-lock lock -f ${conda_env_yaml}/pcgr.yaml --lockfile lock-pcgr.yaml ${CHANNEL_ARGS} -p linux-64
+          conda-lock lock -f ${conda_env_yaml}/pcgrr.yaml --lockfile lock-pcgrr.yaml ${CHANNEL_ARGS} -p linux-64
+          conda-lock render -p linux-64 lock-pcgr.yaml --filename-template 'pcgr-{platform}.lock' && rm lock-pcgr.yaml && mv pcgr-linux-64.lock ${conda_env_lock}/
+          conda-lock render -p linux-64 lock-pcgrr.yaml --filename-template 'pcgrr-{platform}.lock' && rm lock-pcgrr.yaml && mv pcgrr-linux-64.lock ${conda_env_lock}/
Evidence
The workflow no longer renders osx-64 lockfiles, yet osx-64 locks remain committed and docs
reference them; this guarantees drift/staleness for macOS artifacts after future bumps.

.github/workflows/build_conda_recipes.yaml[79-85]
conda/env/lock/pcgr-osx-64.lock[1-4]
pcgrr/vignettes/installation.Rmd[164-172]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The CI now renders only `linux-64` lockfiles, but `osx-64` lockfiles are still present and documentation still instructs users to use them. This will cause macOS lockfiles to become stale/out-of-sync on future releases.
## Issue Context
The PR description indicates `osx-64` is being dropped. If so, the repository should not ship osx lockfiles or macOS lock-based install instructions.
## Fix Focus Areas
- .github/workflows/build_conda_recipes.yaml[79-85]
- conda/env/lock/pcgr-osx-64.lock[1-4]
- conda/env/lock/pcgrr-osx-64.lock[1-4]
- pcgrr/vignettes/installation.Rmd[154-177]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Docker registry docs mismatch ☑ 🐞 Bug ≡ Correctness
Description
The workflow now pushes Docker images to GHCR (ghcr.io/<owner>/<repo>:<VERSION>), but README and
installation docs still direct users to Docker Hub (sigven/pcgr). Users following the docs will pull
from the wrong registry and fail if Docker Hub is no longer being published.
Code

.github/workflows/build_conda_recipes.yaml[R153-164]

+      - name: 🐙 GitHub CR login
+        uses: docker/login-action@v4
     with:
-          username: ${{ secrets.DOCKERHUB_USERNAME }}
-          password: ${{ secrets.DOCKERHUB_TOKEN }}
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
   # use the outputs=docker with dest to directly save to tar for apptainer
   - name: 🐳 Docker img build, tar and push to Docker Hub
-        uses: docker/build-push-action@v6
+        uses: docker/build-push-action@v7
     with:
+          tags: ghcr.io/${{ github.repository }}:${{ env.VERSION }}
+          outputs: type=docker,dest=pcgr_${{ env.VERSION }}.tar
Evidence
CI publication target changed to GHCR, while the repo documentation still advertises Docker Hub as
the source of truth; that mismatch will cause broken pulls for end users.

.github/workflows/build_conda_recipes.yaml[153-164]
README.md[3-6]
pcgrr/vignettes/installation.Rmd[181-187]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Docker publication was switched to GHCR in CI, but docs still tell users to pull from Docker Hub. This will break user installs/pulls if Docker Hub is no longer updated.
## Issue Context
CI now authenticates to `ghcr.io` and tags images as `ghcr.io/${{ github.repository }}:${{ env.VERSION }}`.
## Fix Focus Areas
- .github/workflows/build_conda_recipes.yaml[153-167]
- README.md[3-6]
- pcgrr/vignettes/installation.Rmd[179-213]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the CI/CD and packaging pipeline to support a gitflow-style main/dev branching model, migrate conda builds to rattler-build, update conda lock generation, adjust pkgdown development publishing behavior, and move Docker publishing to GHCR.

Changes:

  • Refactor GitHub Actions workflow to build/upload conda packages via rattler-build, generate linux-only lockfiles, and handle dev label channels on the dev branch.
  • Migrate conda recipes from meta.yaml/build.sh to recipe.yaml format and update conda env YAMLs accordingly.
  • Update pkgdown config for development: mode: auto and switch Docker login/push from Docker Hub to ghcr.io.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/workflows/build_conda_recipes.yaml Reworked conda build/upload, lockfile generation, pkgdown deploy, and Docker deploy flow for main/dev and GHCR.
conda/recipe/pcgr/recipe.yaml New rattler-build recipe for the Python package.
conda/recipe/pcgr/meta.yaml Removed legacy conda-build recipe.
conda/recipe/pcgr/build.sh Removed legacy build script.
conda/recipe/pcgrr/recipe.yaml Converted R recipe to rattler-build format and updated metadata/tests.
conda/recipe/pcgrr/build.sh Removed legacy build script.
conda/env/yaml/condabuild.yaml New build environment for rattler-build + conda-lock.
conda/env/yml/condabuild.yml Removed legacy build environment.
conda/env/yaml/pcgr.yaml Updated package pinning/channel usage and dependency adjustment.
conda/env/yaml/pcgrr.yaml Updated package naming/channel usage.
conda/env/yaml/pkgdown.yaml Updated pcgrr dependency naming for pkgdown env.
.bumpversion.toml Updated version bump targets for renamed/moved conda recipe/env files.
pyproject.toml Version metadata comment update.
pcgr/_version.py Version metadata comment update.
pcgrr/DESCRIPTION Updated RoxygenNote.
pcgrr/pkgdown/_pkgdown.yml Enabled pkgdown auto development mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .bumpversion.toml
Comment on lines 64 to 65
search = "pcgrr =={current_version}"
replace = "pcgrr =={new_version}"
environment-file: ${{ env.conda_env_yaml }}/pkgdown.yaml
activate-environment: pkgdown_env
miniforge-version: latest
- name: 🌐 Website publish
Comment thread .bumpversion.toml
Comment on lines 59 to 60
search = "pcgrr =={current_version}"
replace = "pcgrr =={new_version}"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# use the outputs=docker with dest to directly save to tar for apptainer
- name: 🐳 Docker img build, tar and push to Docker Hub
Comment thread .bumpversion.toml
Comment on lines 57 to 65
[[tool.bumpversion.files]]
filename = "conda/env/yml/pcgrr.yml"
filename = "conda/env/yaml/pcgrr.yaml"
search = "pcgrr =={current_version}"
replace = "pcgrr =={new_version}"

[[tool.bumpversion.files]]
filename = "conda/env/yml/pkgdown.yml"
filename = "conda/env/yaml/pkgdown.yaml"
search = "pcgrr =={current_version}"
replace = "pcgrr =={new_version}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Bumpversion search mismatch 🐞 Bug ✓ Correctness

.bumpversion.toml searches for "pcgrr =={current_version}" in conda env YAMLs, but those files now
pin "r-pcgrr ==…", so bumpversion will fail (or leave pins stale) on the next version bump. This
breaks the automated release workflow and can produce lockfiles/envs pinned to the wrong package
version.
Agent Prompt
## Issue description
`.bumpversion.toml` is configured to update conda env pins using a search string that no longer exists after the refactor (`pcgrr ==...`), while the env files now pin `r-pcgrr ==...`. With `ignore_missing_version = false`, bumpversion will fail (or it will not update the intended files), breaking release automation.

## Issue Context
The conda env YAML files were updated to use `r-pcgrr` as the dependency name. The bumpversion config needs to match that exact string.

## Fix Focus Areas
- .bumpversion.toml[57-65]
- conda/env/yaml/pcgrr.yaml[8-14]
- conda/env/yaml/pkgdown.yaml[6-11]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@sigven sigven left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good:)

@pdiakumis
pdiakumis merged commit 4fcce36 into dev Mar 31, 2026
@pdiakumis
pdiakumis deleted the gha-refac-20260316 branch April 1, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conda: deprecate OSX lockfile Conda: use labels for dev releases Docker: move to GitHub Container Registry

3 participants