GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mehermvr/bump_fetchcontent: Github action to bump dependency versions when using CMake FetchContent

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
bump_fetchcontent
bump_fetchcontent
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
dry_run.py
dry_run.py
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

bump_fetchcontent

GitHub Action that updates CMake FetchContent based dependencies.

Specifically, it does the following:

  • looks through all CMakeLists.txt or *.cmake files in your repo
  • searches for any FetchContent_Declare calls
  • checks if they use the URL style with a file ending in .tar.gz
  • updates the url to a newer version if any

So it looks for dependencies like this:

FetchContent_Declare(
  someLib
  URL https://github.com/user/repo/archive/refs/tags/v1.2.3.tar.gz
)
  • Note: Only github and gitlab links are supported for now.

Of course, the URL style with a .tar.gz link is a very specific use case. But that suffices for my own purposes for now. Contributions welcome to support more cases.

Example workflow

name: Bump FetchContent
on:
  schedule:
    - cron: '0 0 1 * *' # run monthly on the 1st day at midnight UTC
  workflow_dispatch: # allows manual trigger
jobs:
  bump-fetchcontent:
    runs-on: ubuntu-latest
    steps:
      - uses: mehermvr/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          ignore_prereleases: 'true'  # default behavior

Inputs

  • github_token (required): Should be available by default. Needed for making a PR if required.
  • ignore_prereleases (optional): Skips pre-release versions like alpha, rc, or beta. Default is "true".

Dry run

You can dry run the changes on your repo by using the file dry_run.py. It takes a single argument which is your repository git url. It'll clone the repo into a temp folder and check for version updates if any.

About

Github action to bump dependency versions when using CMake FetchContent

Topics

actioncicmakefetchcontentgithub-actions

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.