Rebase main and dev and add .dev to version #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
| name: Rebase main and dev and add .dev to version | |
| on: | |
| workflow_run: | |
| workflows: ["Tag and Release"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| jobs: | |
| rebase: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| fetch-depth: 0 | |
| token: ${{ secrets.BOT_ACCESS_TOKEN }} | |
| - name: Setup Git | |
| run: | | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| - name: Fetch all branches | |
| run: git fetch --all | |
| - name: Rebase dev with main | |
| run: | | |
| git checkout dev | |
| git rebase origin/main | |
| - name: Update the version to <latest>.dev | |
| id: update_version | |
| run: | | |
| version_file="genpipes/__version__.py" | |
| version_number=$(sed -n "s/__version__ = '\([^']*\)'/\1/p" $version_file) | |
| if [[ "$version_number" != *.dev ]]; then | |
| echo "__version__ = '${version_number}.dev'" > $version_file | |
| fi | |
| - name: Commit changes | |
| run: | | |
| git add genpipes/__version__.py | |
| git commit -m "Dev Version update" | |
| git push --force-with-lease |