geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.95k stars 519 forks source link

Make "Subtree Split" using GitHub Actions #1179

Closed jbelien closed 1 year ago

jbelien commented 1 year ago

Until now, Subtree Split service was used to split the main repository to smaller repositories for each component (Common, Http, Plugin) and provider.

There is currently an issue with that service since mid-2022 but I just discovered it now (ping @Nyholm) and I can't seem to figure out what's going on.

Since all of our CI/CD tasks have been migrated to GitHub Actions, I thought about migrating that "Subtree split" to GitHub Actions as well and that's what this PR is about.

This workflow is based on GitHub documentation and works like this:

  1. Detect if there are changes if component/provider directory
  2. If there are changes, extract Git history and directory using git-filter-repo
  3. Push "new" Git history and files to component/provider repository

This workflow requires a GitHub Personal Access Token (PAT). I've configured a personal token and have stored as SUBTREE_GITHUB_TOKEN organization secret.

jbelien commented 1 year ago

I've checked (in production) with Nominatim provider and the repository has been updated correctly.

See https://github.com/geocoder-php/Geocoder/actions/runs/4302453528/jobs/7500974297

Nyholm commented 1 year ago

Lovely!