Merge pull request #20 from nullStack65/dev #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Sync releases back to dev after release-please creates a release | |
| # This ensures dev stays up-to-date with version bumps and changelog updates | |
| name: Sync to Dev | |
| on: | |
| push: | |
| branches: [releases] | |
| paths: | |
| - 'pyproject.toml' | |
| - 'microfinity/__init__.py' | |
| - 'CHANGELOG.md' | |
| jobs: | |
| sync: | |
| name: Sync releases to dev | |
| runs-on: ubuntu-latest | |
| # Only run if this looks like a release-please commit | |
| if: contains(github.event.head_commit.message, 'chore(releases)') || contains(github.event.head_commit.message, 'chore(main)') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Sync version files to dev | |
| run: | | |
| # Get the version from releases branch | |
| VERSION=$(grep -m1 'version = ' pyproject.toml | cut -d'"' -f2) | |
| echo "Syncing version $VERSION to dev" | |
| # Checkout dev branch | |
| git checkout dev | |
| # Cherry-pick the version bump changes (if they apply cleanly) | |
| # Or directly update the version files | |
| git checkout releases -- pyproject.toml microfinity/__init__.py CHANGELOG.md | |
| # Check if there are changes | |
| if git diff --quiet; then | |
| echo "No changes to sync" | |
| exit 0 | |
| fi | |
| # Commit and push | |
| git add pyproject.toml microfinity/__init__.py CHANGELOG.md | |
| git commit -m "chore: sync version $VERSION from releases" | |
| git push origin dev |